我有一个用于构建nuget分发项目的msbuild。它构建了我的程序集的.net 3.5,.net 4.0和.net 4.5目标版本,以便于打包。在Windows上,这总是很好用,但是现在我使用xbuild进行单声道操作,除了.NET 3.5目标版本外,一切正常。
我收到类似
的错误/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)
不确定我缺少什么,因为程序集对所有其他目标都是可读的。
确定,文件确实存在
>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*
-
编辑:
有趣的是,我实际上在Xamarin Studio中将我的项目定位到.NET 3.5时遇到了同样的错误。我不确定这是不是一个错误,或者其他东西是否发生了变化,这不应该起作用。
答案 0 :(得分:2)
IIRC最新版本的开源F#编译器(在github上托管的版本)默认为.NET 4.0。您需要自己编译F#以调整构建,以允许它安装必要的.NET 3.5位。