F# FSI "Unexpected compiler generated literal in interaction" with "#I __SOURCE_DIRECTORY__"

174 views Asked by At

If I create a new F# file 'Test.fsx' in VSCode with the line

#I __SOURCE_DIRECTORY__

attempting to run the code in FSI generates the error

Test.fsx(2,4): error FS0010: Unexpected compiler generated literal in interaction. Expected incomplete structured construct at or before this point, ';', ';;' or other token.

Any idea what might be going wrong?

1

There are 1 answers

0
smoothdeveloper On

It is a known issue in VS2019, which has been fixed in VS2022.

https://github.com/dotnet/fsharp/issues/13467

You may replace the code with

#I "."

Related Questions in F#