基本CLI库'mscorlib'与引用的F#核心库二进制不兼容

Gob*_*ner 5 .net f# compiler-errors

我已经建立了一个网站,它接受代码片段并编译它们并运行它们.但是,F#在服务器上被破坏了.每当我尝试编译F#代码时,我都会收到以下错误消息:

The referenced or default base CLI library 'mscorlib' is binary-incompatible with the referenced F# core library 'C:\Program Files (x86)\Microsoft F#\v4.0\FSharp.Core.dll'. Consider recompiling the library or making an explicit reference to a version of this library that matches the CLI version you are using.

Error opening binary file 'C:\Program Files (x86)\Microsoft F#\v4.0\FSharp.Core.dll': Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+ReportedError' was thrown.

To be clear, this is an error being returned by the compiler, not an error that occurs when the code is run.

The site runs just fine on my development machine and works just fine on a VM I spun up to help diagnose the issue.

The only Google hit for the error message caused me to try cleaning up the F#/.NET install to no avail. I did a repair install of the framework and uninstalled/reinstalled the F# packages I'm using.

Example: http://dotnetpad.net/ViewPaste/ZvXBgizf70q83Fk6VmboHw

F# compilation code: http://bitbucket.org/gobiner/.net-pad/src/tip/DotNetPad/Compilers/FSharpCompiler.cs

Bri*_*ian 2

您传递给服务器上的 fsc.exe 的命令行是什么?听起来你正在-r使用 FSharp.Core 4.0 但使用 mscorlib 2.0。请务必在命令行上传递对两者的显式引用。构建示例命令行时,请检查 Visual Studio 中的输出窗口。

编辑

看这个问题:

VS2008 和 VS2010 并行的 FSharp.Compiler.CodeDom