我想從命令行運行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
有人可以幫助我嗎?謝謝。