hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

#use in script edited in Visual Studio

Last post 06-19-2008, 7:54 by fractal76. 0 replies.
Sort Posts: Previous Next
  •  06-19-2008, 7:54 6174

    #use in script edited in Visual Studio

    I have a couple of fsx files (ie scripts) that I edit in Visual Studio 2008. I have a lot of common setup code between the files. There is a bunch of #I, #r and open SomeNamespace that load my libraries, and then I setup a couple of commonly needed objects that I need to use in every script (for example I load up Date objects with definitions for today/yesterday etc). So ideally I would like to abstract out all the common setup stuff into a common file that gets included into every script that needs to use this.

    I have tried using #use directive. It works great if I invoke scripts via fsi.exe. But Visual Studio starts showing a bunch of errors since it does not actually include the common file at edit time. What is the best approach for this? I understand that I can setup my objects in the common module and then just load it; but I also want to "open" all the namespaces so that I dont need a dozen open statements in each script file.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems