3

fsharp.Core の wp7 バージョン ( Windows Phone 7.1 および F# 3.0 用の FSharp.Core ) をビルドするために、fsharp コンパイラのソース コードをいじってみましたが、ある時点であきらめて、移植可能なものを作ろうとし始めました。バージョンは代わりに wp7 で動作します。FX_NO_STRUCTURAL_EQUALITY定義をターゲット フレームワークに追加しましたportable-net4+sl4+wp71+win8。これが実行時に動作しない原因のようで、FSharp.Core.dll をC:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortableカスタム バージョンに置き換えようとしました。しかし、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 バージョン。ソースからポータブル バージョンを正常にビルドした人はいますか?

4

2 に答える 2

1

あなたができることは追加することです:

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

FSharp.Source.Targetsファイルに。<DefineConstants>要素の後にこの正しいファイルを実行します。これにより、コンパイルフェーズではmscorlib、msbuildターゲットで指定されたデフォルトのバージョンではなく、指定したバージョンが使用されます。(明らかに正しいものと交換pathToTheCorrectmscorlib/mscorlib-runtime.dllしてください:))

于 2013-02-11T10:57:12.130 に答える
1

いくつかの変更を行った後、F# ソースから Profile88 にコンパイルされたポータブル net4+sl4+wp71+win8 ターゲットを取得しましたhttps://github.com/ovatsus/fsharp

ただし、実行時に徹底的にテストする必要があります

于 2013-02-18T14:27:17.887 に答える