Any ideas what's happening here?
If you manually enter in the VS FSI window
printfn __SOURCE_DIRECTORY__;;
you will get something like
C:\...
If you enter in an fsx file and then send to FSI
printfn __SOURCE_DIRECTORY__;;
you will get the directory where the fsx file is located like
E:\Projects...
Note: I did these examples using VS 2010 on Windows 7.
See my __SOURCE_DIRECTORY__
notes
How could I set the value to the one that I expect?
There has been a change between VS 2010 and VS 2012 when using relative directories, but if it works for VS 2010 it works for VS2012 but not the other way around.
In our project we used an initialization.fsx file which correctly uses #I and #r. e.g.
#I @".\..\FSharpx.Books.AutomatedReasoning\bin\Debug"
#r @"FSharpx.Books.AutomatedReasoning.dll"