I have a 开发者_StackOverflow中文版F# project for which I would like to use .NET 4 (for System.Numerics
). However when I try to compile in .NET 4 (I'm using MonoDevelop) I got the error:
unknown-file: Error 0: warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-incompatible with the referenced library '/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/mono/4.0/System.dll'. Consider recompiling the library or making an explicit reference to a version of this library that matches the CLI version you are using. (0) (ApproximationSuite)
Does anyone know how I can get round this?
Make an explicit reference to mscorlib, version 4 like this:
<Reference Include="mscorlib" />
Then another, similar error can show up (that you have not compatible FSharp.Core). This is because it is not 4.0 version of this library. You do not, however, need to recompile, as you can find compiled version in v4.0 subdirectory from package like this (note that its script does not installs v4.0 to gac). If you put 4.0 version to a place where MonoDevelop looks for it (probably /usr/lib/fsharp/), it should compile just fine.
You can recompile FSharp.Core.dll and fsc.exe targeting it to 4.0 version and then use that FSharp.Core.dll. Should work. I assume that it worked for you in 2.0. If not, please give some details about project (maybe part of fsprojs?).
精彩评论