我有一个用F# 4.1
编写的项目,使用Nunit 3.6.1
。我使用VisualStudio 2017
来构建项目,使用NUnit Console Runner 3.6.1
来运行测试。但是,当我尝试运行我的测试时,会收到一个错误:
C:\ projects \ AzureLogsDownloader \ packages \ NUnit.ConsoleRunner.3.6.1 \ tools> nunit3-console.exe“C:\ projects \ AzureLogsDownloader \ AzureLogs.Core.Tests \ bin \ Debug \ AzureLogs.Core.Tests .DLL“
无法加载文件或程序集'FSharp.Core,Version = 4.4.1.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。系统找不到指定的文件。(HRSULT:0x80131040)
我尝试将FSharp.Core
复制到测试跑步者的文件夹,但它没有帮助。
如何修复此问题并运行我的测试?
答案 0 :(得分:0)
只有几个必要的步骤:
app.config
文件<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>
<dependentAssembly>
<assemblyIdentity name="NUnit.Framework" publicKeyToken="2638cd05610744eb" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="3.6.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>