【问题标题】:Xbuild to build F# 3 targeting .NET 3.5Xbuild 构建面向 .NET 3.5 的 F# 3
【发布时间】:2013-12-18 20:49:29
【问题描述】:

我有一个 msbuild,用于构建用于 nuget 分发的项目。它构建了我的程序集的 .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 时遇到了同样的错误。我不确定这是一个错误,还是其他地方发生了变化,这本来就不应该起作用。

【问题讨论】:

    标签: f# mono xamarin-studio xbuild


    【解决方案1】:

    IIRC 最新版本的开源 F# 编译器(托管在 github)默认为 .NET 4.0。您需要自己编译 F# 来调整构建以允许它安装必要的 .NET 3.5 位。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-11
      • 2022-08-16
      • 1970-01-01
      相关资源
      最近更新 更多