2017-07-24 68 views
2

我已經安裝了mono-complete,nuget和nunit。在Ubuntu上運行NUnit測試:加載測試時驅動程序發生異常

我正在使用NUnit Console Runner來運行nunit測試用例。

NUnit的控制檯亞軍3.7.0 版權所有(C)2017年查理·普爾,羅布Prouse

運行環境 OS版本:Linux的4.4.0.1020 CLR版本:4.0.30319.17020

測試文件 SampleNUnit的.dll

錯誤,故障和警告

1)錯誤: 的例外? n在加載測試時發生在驅動程序中。 (包裝管理到本地)System.Object:__ icall_wrapper_mono_remoting_wrapper(intptr,intptr) at(wrapper remoting-invoke)NUnit.Engine.Agents.RemoteTestAgent:Run(NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter) 在NUnit.Engine.Runners.ProcessRunner.RunTests(ITestEventListener聽者,NUnit.Engine.TestFilter濾波器)< 0x40ae1bb0 + 0x000ae>在:0

測試運行概要 總體結果:無法 測試計數:0,通過: 0,失敗:0,警告:0,不確定:0,跳過:0 開始時間:2017-07-24 22:38:51Z 結束時間:2017-07-24 22:38:51Z 持續時間:0.403秒

感謝您的幫助,以便我可以運行NUnit測試用例。

回答

0

在相關的NUnit issue中提到您使用mcs來編譯一個測試文件。相反,如果您在您的Mono版本上使用xbuild進行編譯(在較新版本上爲msbuild),您會發現它可以按預期工作。

xbuild /p:Configuration=Release NUnitTest.sln 
+0

我可以讓它與xbuild一起工作。那就是: xbuild /p:TargetFrameworkVersion="v4.5「/ p:Configuration = Release SampleNUNIT.sln –

+0

使用mcs有什麼問題? –

+0

請參閱https://stackoverflow.com/questions/18245811/creating-a-net-solution-on-the-command-line-with-mono xbuild不能替代命令行方法。 –