I've built a website that takes code snippets and compiles them and runs them. However, F# is broken on the server. Whenever I try to compile F# code I get the following error message:
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