FsUnit.xUnit FSharp.Core程序集绑定

时间:2016-07-26 21:04:11

标签: f# xunit fsunit

我正在尝试使用FSUnit.xUnit编写单元测试项目。

在这个过程的整个开发过程中,我一直受到测试失败的困扰(并不总是引用相同的版本):

Could not load file or assembly 'FSharp.Core, Version=3.259.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

添加绑定重定向似乎没有任何效果。我最近的一个是:

  <configuration>
    <runtime>
      <dependentAssembly>
        <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
      </dependentAssembly>
    </runtime>
    <startup>
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
    </startup>
  </configuration>

到目前为止唯一有效的方法是降级FSharp.Core NuGet软件包,但在最新版本中,即使这样也失败了。

我在这个问题上失去了很多时间。非常感谢任何帮助。

更新

据我所知,这是由于Json.NET中的一个错误。测试正在运行,但是当我对受歧视的联合进行序列化和反序列化时,错误正在程序集中抛出。我在Json.NET中提交了一个问题。

进一步更新

我从针对F#版本4.4.0.0的测试项目调用Json.NET序列化程序,我尝试序列化的对象是在带有Profile259的便携式程序集中定义的(portable-net45 + netcore45 + wpa81 + wp8) 。便携式组件包含相同的绑定重定向。

0 个答案:

没有答案