Can I specify which external F# compiler should be used in LINQPad?
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):
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
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
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'll have to investigate further.
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