W jaki sposób polecenie F # Interactive #I wie o ścieżce projektu?

Oto scenariusz:

Otwórz program Visual Studio. Dokonano tego w VS2010 Pro.Otwórz F # Interactive w Visual StudioOtwórz projekt z plikiem fsx
Uwaga: Projekt i plik fsx są włączoneE:\<directories>\fsharp-tapl\arith

Wyślij polecenia do F # Interactive z pliku fsx

> System.Environment.CurrentDirectory;; 
val it : string = "C:\Users\Eric\AppData\Local\Temp"

Nie spodziewałem się katalogu Temp, ale ma to sens.

> #r @"arith.exe"
Examples.fsx(7,1): error FS0082: Could not resolve this reference. 
Could not locate the assembly "arith.exe". 
Check to make sure the assembly exists on disk. 
If this reference is required by your code, you may get compilation errors. 
(Code=MSB3245)

Examples.fsx(7,1): error FS0084: Assembly reference 'arith.exe' was not found 
or is invalid

Błąd polecenia #r pokazuje, że F # Interactive obecnie nie zna lokalizacji arith.exe.

> #I @"bin\Debug"
--> Added 'E:\<directories>\fsharp-tapl\arith\bin\Debug' 
to library include path

Mówimy więc F # Interactive o lokalizacji arith.exe. Zauważ, że ścieżka NIE jest ścieżką absolutną, ale ścieżką podrzędną projektu. Nie powiedziałem F # Interactive o lokalizacji projektu arithE:\<directories>\fsharp-tapl\arith

> #r @"arith.exe"
--> Referenced 'E:\<directories>\fsharp-tapl\arith\bin\Debug\arith.exe'

A F # Interactive poprawnie stwierdza, że ​​arith.exe podaje poprawną ścieżkę bezwzględną.

> open Main
> eval "true;" ;;
true
val it : unit = ()

Potwierdza to, że arith.exe został poprawnie znaleziony, załadowany i działa.

Skąd więc F # Interactive #I zna ścieżkę projektu, ponieważ bieżący katalog nie pomaga?

To, czego naprawdę szukam, pochodzi z F # Interactive, jak uzyskać ścieżkę do projektu,E:\<directories>\fsharp-tapl\arith.

EDYTOWAĆ

> printfn __SOURCE_DIRECTORY__;;
E:\<directories>\fsharp-tapl\arith
val it : unit = ()

questionAnswers(1)

yourAnswerToTheQuestion