我一直在研究 fsharp 编译器源代码以尝试构建 FSharp.Core 的 wp7 版本(适用于 Windows Phone 7.1 和 F# 3.0的 FSharp.Core ),有一次我放弃并开始尝试制作便携式版本与 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 版本。有没有人从源代码成功构建了便携式版本?