3
votes

I have a 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?

2
What version of Mono do you use? - abatishchev
mono version 2.10.1 monoDevelop version 2.4.2 - Aidan
Note that the 2.0 version of F# still contains System.Numerics.BigInteger (inside FSharp.Core.dll). - Brian
Fair point, thanks. I was actually hoping to use Complex - Aidan

2 Answers

2
votes

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.

1
votes

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?).