Can't run F# after updating Visual Studio 2017
I just updated my Visual Studio 2017 installation to the latest version (15.6.0) and now I'm unable to run F# script. When I try a dialog box says that "fsc.exe has stopped working" and the following message appears in LINQPad:
"Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Compiler.Private, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.FSharp.Compiler.CommandLineMain.main(String[] argv)"
I tried with the latest release and the latest beta of LINQPad, both have the same behavior.
"Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Compiler.Private, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.FSharp.Compiler.CommandLineMain.main(String[] argv)"
I tried with the latest release and the latest beta of LINQPad, both have the same behavior.
Comments
-
Can you successfully invoke fsc.exe from the command-line?
-
Yes, it works. I tried with this one:
C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0\fsc.exe
which is the latest installed and pointed by the env variable:FSHARPINSTALLDIR
I tried to compile an hello world file:C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0>fsc.exe test.fs
Furthermore I have no issue using F# into Visual Studio 2017.
Microsoft (R) F# Compiler version 10.1.0 for F# 4.1
Copyright (c) Microsoft Corporation. All Rights Reserved.
Here is the crash report, it seems LINQPad doesn't use the latest F# compiler version:Version=1
EventType=APPCRASH
EventTime=131649009150680001
ReportType=2
Consent=1
UploadTime=131649009150970001
ReportIdentifier=c719dff2-2206-11e8-bb67-64006a97e428
IntegratorReportIdentifier=c719dff1-2206-11e8-bb67-64006a97e428
WOW64=1
Response.BucketId=4259334386
Response.BucketTable=475309946
Response.type=4
Sig[0].Name=Application Name
Sig[0].Value=fsc.exe
Sig[1].Name=Application Version
Sig[1].Value=2017.11.4.1
Sig[2].Name=Application Timestamp
Sig[2].Value=59fdf2a1
Sig[3].Name=Fault Module Name
Sig[3].Value=KERNELBASE.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=6.1.7601.24024
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=5a58e25a
Sig[6].Name=Exception Code
Sig[6].Value=e0434352
Sig[7].Name=Exception Offset
Sig[7].Value=0000c54f
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=6.1.7601.2.1.0.256.27
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=4108
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=0a9e
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=0a9e372d3b4ad19135b953a78882e789
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=0a9e
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=0a9e372d3b4ad19135b953a78882e789
UI[2]=C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\fsc.exe
UI[3]=fsc.exe has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\fsc.exe
LoadedModule[1]=C:\WINDOWS\SysWOW64\ntdll.dll
LoadedModule[2]=C:\WINDOWS\SYSTEM32\MSCOREE.DLL
LoadedModule[3]=C:\WINDOWS\syswow64\KERNEL32.dll
LoadedModule[4]=C:\WINDOWS\syswow64\KERNELBASE.dll
LoadedModule[5]=C:\WINDOWS\syswow64\ADVAPI32.dll
LoadedModule[6]=C:\WINDOWS\syswow64\msvcrt.dll
LoadedModule[7]=C:\WINDOWS\SysWOW64\sechost.dll
LoadedModule[8]=C:\WINDOWS\syswow64\RPCRT4.dll
LoadedModule[9]=C:\WINDOWS\syswow64\SspiCli.dll
LoadedModule[10]=C:\WINDOWS\syswow64\CRYPTBASE.dll
LoadedModule[11]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
LoadedModule[12]=C:\WINDOWS\syswow64\SHLWAPI.dll
LoadedModule[13]=C:\WINDOWS\syswow64\GDI32.dll
LoadedModule[14]=C:\WINDOWS\syswow64\USER32.dll
LoadedModule[15]=C:\WINDOWS\syswow64\LPK.dll
LoadedModule[16]=C:\WINDOWS\syswow64\USP10.dll
LoadedModule[17]=C:\WINDOWS\system32\IMM32.DLL
LoadedModule[18]=C:\WINDOWS\syswow64\MSCTF.dll
LoadedModule[19]=C:\WINDOWS\system32\VERSION.dll
LoadedModule[20]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
LoadedModule[21]=C:\WINDOWS\system32\MSVCR120_CLR0400.dll
LoadedModule[22]=C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\mscorlib\30bf1921503412fa2b0b70c448bd4ab8\mscorlib.ni.dll
LoadedModule[23]=C:\WINDOWS\syswow64\ole32.dll
LoadedModule[24]=C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System\3c3125abff791d75454612d56a7da162\System.ni.dll
LoadedModule[25]=C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Core\1d432538b7e0e3d52913aa4f5b36e8d8\System.Core.ni.dll
LoadedModule[26]=C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\FSharp.Core\4fa4b6b0fbc0e5da4f779ed39949905b\FSharp.Core.ni.dll
LoadedModule[27]=C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\fsc\08d9c634bfa9afc4aceae5b511c38152\fsc.ni.exe
LoadedModule[28]=C:\WINDOWS\system32\api-ms-win-core-xstate-l2-1-0.dll
LoadedModule[29]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
LoadedModule[30]=C:\WINDOWS\syswow64\OLEAUT32.dll
LoadedModule[31]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
State[1].Key=DataRequest
State[1].Value=Bucket=-35632910/nBucketTable=475309946/nResponse=1/n
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=fsc.exe
AppPath=C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\fsc.exe -
I had a similar problem.
I eventually copied the contents of "C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0" from one of my other computers to get everything working again. -
Note that in recent betas, there's an option in Edit | Preferences | Advanced to force LINQPad to always use the internal F# compiler. That will usually fix that kind of error.