gpt4 book ai didi

f# - 使用自定义版本的 FSharp.Core.dll

转载 作者:行者123 更新时间:2023-12-02 02:06:29 24 4
gpt4 key购买 nike

我一直在研究 fsharp 编译器源代码,试图构建一个 wp7 版本的 FSharp.Core ( FSharp.Core for Windows Phone 7.1 and F# 3.0 ),有一次我放弃了,开始尝试让可移植版本与 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依赖于可移植的2.0.5.0版本的mscorlib.dll、System.dll和System.Core.dll这些程序集,而我从源码编译的依赖于不可移植的 4.0.0.0 版本。有没有人从源代码成功构建了便携版本?

最佳答案

你可以做的是添加:

<OtherFlags>$(OtherFlags) --simpleresolution -r:"pathToTheCorrectmscorlib/mscorlib-runtime.dll" </OtherFlags>

FSharp.Source.Targets文件。在 <DefineConstants> 之后执行此正确的文件元素。这应该会导致编译阶段使用 mscorlib 的版本您指定的版本,而不是 msbuild 目标指定的默认版本。 (显然用正确的替换 pathToTheCorrectmscorlib/mscorlib-runtime.dll :))

关于f# - 使用自定义版本的 FSharp.Core.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14791925/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com