I have an msbuild that I use to build a project for nuget distribution. It builds out .net 3.5, .net 4.0, and .net 4.5 targeted versions of my assembly for easy packaging. On windows this has always worked great, but right now I'm on mono using xbuild and everything works except the .NET 3.5 targeted build.
I get an error like
/Users/akropp/Projects/code/ParsecClone/combinator.msbuild.proj (default targets) ->
(Build target) ->
/Users/akropp/Projects/code/ParsecClone/Combinator/Combinator.fsproj (default targets) ->
/Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/4.0/Microsoft.FSharp.Targets (CoreCompile target) ->
: error FS0219: The referenced or default base CLI library 'mscorlib' is binary-incompatible with the referenced F# core library '/Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/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 FS0218: Unable to read assembly '/Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/FSharp.Core.dll'
0 Warning(s)
2 Error(s)
Not sure what I'm missing since the assembly is readable for all the other targets.
Just to be sure, the file does exist
>ls /Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/FSharp.Core.*
-rwxr-xr-x 1 root admin 1104896 Nov 14 15:14 /Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/FSharp.Core.dll*
-rwxr-xr-x 1 root admin 353617 Nov 14 15:18 /Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/FSharp.Core.optdata*
-rwxr-xr-x 1 root admin 488574 Nov 14 15:18 /Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/FSharp.Core.sigdata*
-rwxr-xr-x 1 root admin 592077 Nov 14 15:18 /Library/Frameworks/Mono.framework/Versions/3.2.5/lib/mono/gac/FSharp.Core/4.3.0.0__b03f5f7f11d50a3a/FSharp.Core.xml*
--
Edit:
Interestingly enough, I actually get the same error targeting my project to .NET 3.5 in Xamarin Studio. I'm not sure if this is a bug or if something else has changed and this isn't supposed to work in the first place.
IIRC the latest versions of the opensource F# compiler (the one hosted at github) default to .NET 4.0. You would need to compile F# yourself to tweak the build to allow it to install the necessary .NET 3.5 bits.