FsUnit.xUnit FSharp.Core и связывание сборки xunit.assert
Я делаю свои первые шаги с F# и тестирую с FsUnit.xUnit. В Visual Studio 2017 я создал новый проект F# и добавил тестовый проект. В тестовом проекте я NuGet FsUnit.xUnit 3.0.0, а затем NuGet FsUnit.xUnit.Sample. Все строит. Затем тесты проваливаются с
System.IO.FileLoadException
Could not load file or assembly 'FSharp.Core, Version=4.3.1.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)
at ApplicationLibraryTest.Tests.Given a LightBulb that has had its state set to true.when I ask whether it is On it answers true.()
После прочтения домашней страницы FsUnit и проблем с FsUnit я добавляю 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-999.999.999.999" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Как FSharp.Core.dll в bin/debug
это версия 4.4.1.0.
Запуск тестов снова дает
System.IO.FileLoadException
Could not load file or assembly 'xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at ApplicationLibraryTest.Tests.Given a LightBulb that has had its state set to true.when I ask whether it is On it answers true.() in D:\git\ApplicationLibrary\ApplicationLibraryTest\FsUnitSample.fs:line 18
Поэтому я добавляю еще один редирект в app.config
следующее
<dependentAssembly>
<assemblyIdentity name="xunit.assert" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="2.2.0.0" />
</dependentAssembly>
версия 2.2.0.0 является версией xunit.assert, которую я нахожу в bin\debug
,
И снова испытания не пройдены. На этот раз с
System.IO.FileLoadException
Could not load file or assembly 'xunit.assert, Version=2.2.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at ApplicationLibraryTest.Tests.Given a LightBulb that has had its state set to true.when I ask whether it is On it answers true.() in D:\git\ApplicationLibrary\ApplicationLibraryTest\FsUnitSample.fs:line 18
System.IO.FileLoadException
Could not load file or assembly 'xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
Exception doesn't have a stacktrace
Детали тестового проекта: Целевая среда F#: 4.4.1.0
Целевая структура: 4.6.2
Что я делаю неправильно? Это проблема конфигурации, или мне чего-то не хватает, что мешает FsUnit.xUnit запускать тесты?