7

通常の F# ライブラリで記述された NUnit 単体テストがありますが、ポータブル クラス ライブラリの F# コードを対象としています。

このテストを (Visual Studio 2013 で) 実行すると、次の例外が発生します。

Result Message: System.MissingMethodException : Method not found:
 'Microsoft.FSharp.Control.FSharpAsync`1<System.IO.TextReader> FSharp.Data.Runtime.IO.asyncReadTextAtRuntime(System.Boolean, System.String, System.String, System.String, System.String)'.

これは、ポータブル クラス ライブラリの app.config にあるものです。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

これは、通常の F# ライブラリの app.config にあるものです。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.3.13283" newVersion="2.6.3.13283" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
4

4 に答える 4

4

どうやら、FSharp.Data はプロファイル 7 を使用する PCL ライブラリをサポートしていないようです。PCL プロジェクト プロファイルを 47 に変更すると、すべてが期待どおりに機能します。

于 2014-05-01T08:39:19.197 に答える
0

DLL のバージョンを以前のバージョンに更新しました。

私の場合、FSharp.Data DLL でタイプ プロバイダーを使用しようとしていました。

FSharp.Data を以前のバージョンに更新したところ、エラーはなくなりました。

于 2017-02-19T13:37:27.510 に答える