【发布时间】:2013-02-09 21:43:08
【问题描述】:
我一直在研究 fsharp 编译器源代码以尝试构建 FSharp.Core (FSharp.Core for Windows Phone 7.1 and F# 3.0) 的 wp7 版本,但有一次我放弃并开始尝试使可移植版本与 wp7 一起使用反而。我将FX_NO_STRUCTURAL_EQUALITY 定义添加到portable-net4+sl4+wp71+win8 目标框架中,这似乎是导致它在运行时不起作用的原因,并尝试用我的自定义版本替换C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable 中的FSharp.Core.dll。但是在 Visual Studio 中编译时出现此错误:
Warning 1 The primary reference "FSharp.Core" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile47". To resolve this problem, either remove the reference "FSharp.Core" or retarget your application to a framework version which contains "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1578 5 FSharp.Data.Portable
Warning 3 The primary reference "FSharp.Core" could not be resolved because it has an indirect dependency on the framework assembly "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile47". To resolve this problem, either remove the reference "FSharp.Core" or retarget your application to a framework version which contains "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1578 5 FSharp.Data.Portable
Warning 2 The primary reference "FSharp.Core" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile47". To resolve this problem, either remove the reference "FSharp.Core" or retarget your application to a framework version which contains "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1578 5 FSharp.Data.Portable
问题是VS2012自带的可移植FSharp.Core依赖于mscorlib.dll、System.dll和System.Core.dll这些程序集的可移植2.0.5.0版本,但我从源代码编译的依赖于非便携式 4.0.0.0 版本。有人从源代码成功构建了便携式版本吗?
【问题讨论】:
-
您可以尝试使用 bindingRedirect 添加 app.config,例如apollo13cn.blogspot.co.uk/2012/02/…
-
Silverlight 或 WindowsPhone 都不支持程序集重定向
标签: f# mono portable-class-library