本文介绍了使用FSharp.Core.dll的自定义版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究fsharp编译器源代码,以尝试构建wSharp.Core版本的FSharp.Core(),有一次我放弃并开始尝试使便携式版本与wp7代替.我在portable-net4+sl4+wp71+win8目标框架中添加了FX_NO_STRUCTURAL_EQUALITY定义,这似乎导致它在运行时无法正常工作,并尝试用自定义版本替换C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable中的FSharp.Core.dll.但是在Visual Studio中编译时出现此错误:

I've been poking around with the fsharp compiler source code to try to build a wp7 version of FSharp.Core (FSharp.Core for Windows Phone 7.1 and F# 3.0), and at one point I gave up and started trying to make the portable version work with wp7 instead. I added the FX_NO_STRUCTURAL_EQUALITY define to the portable-net4+sl4+wp71+win8 target framework, which seems to what's causing it to not work at runtime, and tried to replace the FSharp.Core.dll in C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable with my custom version. But I get this errors when compiling in 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版本.有人从源头成功构建了便携式版本吗?

The problem is that the portable FSharp.Core that comes with VS2012 depends on the portable 2.0.5.0 versions of mscorlib.dll, System.dll and System.Core.dllthose assemblies, but the one I compile from source depends on the non-portable 4.0.0.0 versions. Has anyone built the portable version successfully from source?

推荐答案

在进行了几处更改后,将可移植的net4 + sl4 + wp71 + win8目标从F#源编译为Profile88. .com/ovatsus/fsharp"rel =" nofollow> https://github.com/ovatsus/fsharp

Got the portable-net4+sl4+wp71+win8 target compiling to Profile88 from F# source after a couple of changes https://github.com/ovatsus/fsharp

尽管如此,仍然需要在运行时进行全面测试

Still need to thoroughly test at runtime, though

这篇关于使用FSharp.Core.dll的自定义版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 16:04