Home

Can I specify which external F# compiler should be used in LINQPad?

edited March 2019
I have Visual Studio 2017(F# 4.5) and Visual Studio 2019(F# 4.6) installed, but seems that my F# compiler did not pick up the F# 4.6 features. Can I specify F# 4.6 instead of 4.5 in LINQPad?

Simple example(Should run in F# 4.6):
let data = {| X = 1; Y = 2 |}
But failed with:
) or end of expression expected (change the Query Language to 'C# Statements' for statement-based queries)

Comments

  • @JoeAlbahari Please take a look on this and try to upgrade to F# 4.6.
  • Do you know which folder the F# 4.6 compiler is installed to? I've looked in Program Files\Microsoft SDKs\F# and it doesn't appear to be there.
  • edited May 2019
    Here is the path of the fsharp compiler
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe

    or for the .net core version
    C:\Program Files\dotnet\sdk\<<version>>\FSharp\fsc.exe
  • Getting the same issue here. I've got VS 2019 preview installed and so my path is C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\CommonExtensions\Microsoft\FSharp
    but I notice my Linqpad is picking fsc.exe up from
    C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0

    I noticed Linqpad searches the Linqpad.exe directory so tried hacking and stuffing fsc.exe and FSharp.Core.dll into there, but I now get the error "Expected a valid default FSharpBinariesDir".
    Also tried hacking a copy into the SDK diectory, but no luck "fooling" linqpad that way either....

    @JoeAlbahari Out of ideas
  • I get a bunch of errors when trying to use the preview fsc.exe.

    I'll have to investigate further.
  • Some more testing this end-
    1. Via procmon I worked out Linqpad.exe is using C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0 for the fsc.exe
    2. Created a 4.6 directory, and copied the contents of my VS2019 F# SDK in. But linqpad.exe would not pick it up (not sure how the search logic work)
    3. Temporarily renamed the 4.1 directory, and then named the 4.6 directory to 4.1
    4. Linqpad now picks up the 4.6 fsc.exe (in the 4.1 directory). The anonymous record will execute, but the editor still does not like the syntax (red squiggles)
    5. Tried fsc.exe form https://github.com/dotnet/core-sdk#installers-and-binaries but I think the links are broke, because none of the fsc.exe's the I downloaded for windows would even run in a command prompt!

    Let me know if you need any tests run. Ta
Sign In or Register to comment.