Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mscorlib error using .NET 4 on Mono using Mac OSX

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?

like image 887
Aidan Avatar asked Feb 26 '26 04:02

Aidan


1 Answers

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.

like image 117
argie Avatar answered Feb 27 '26 20:02

argie