我想从命令行运行NUnit v3 alpha。这是我的命令行: [...] \ NUnit3 \ NUnit控制台NUnitAlpha3Experimental.exe /framework:net-4.5命令行中的NUnit v3 alpha:程序集清单定义与程序集引用不匹配。 (异常来自HRESULT:0x80131040)
起初,我得到这个错误:
Errors and Failures Could not load file or assembly 'nunit.framework, Version=3.0.5378.31152, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
然后我编辑nunit- console.exe.config评论.NET 2.0
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<!--<supportedRuntime version="v2.0.50727" />-->
<supportedRuntime version="v4.0.30319" />
</startup>
我尝试了这些命令行(具有4.0和4.5) [...] \ NUnit3 \ NUnit控制台NUnitAlpha3Experimental.exe /framework:net-4.0 [...] \ NUnit3 \ nunit-console NUnitAl pha3Experimental.exe /framework:net-4.5
这里的错误消息我得到:
Errors and Failures Could not load file or assembly 'nunit.framework, Version=3.0.5378.31152, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
然后我试图修改NUnit的-console.exe.config增加对.NET 4.5的新条目。我试过4.5,4.5.1,4.5.50710,4.5.50938,4.5.50932,4.5.51641(它们全都存在于控制面板 - >程序和功能中),我得到一个窗口弹出窗口,要求我安装.Net框架4.5。
编辑:.Net框架4.5 *的新条目不应该反正。即使出现错误信息,单元测试也会运行。更多的信息在这里:https://github.com/nunit/nunit-console/issues/42#issuecomment-58709851
有人可以帮助我吗?谢谢。