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.