我正在使用NUnit 2.5和NAnt 0.85來編譯.NET 3.5庫。由於NAnt 0.85不支持.NET 3.5以上的版本,因此我已將3.5框架的條目添加到NAnt.exe.config。NAnt未運行NUnit測試
'MyLibrary'構建,但是當我點擊「測試」目標執行NUnit測試時,它們都沒有運行。
[nunit2] Tests run: 0, Failures: 0, Not run: 0, Time: 0.012 seconds
下面是我NAnt.build文件中的條目爲構建和運行測試:
<target name="build_tests" depends="build_core">
<mkdir dir="Target" />
<csc target="library" output="Target\Test.dll" debug="true">
<references>
<include name="Target\MyLibrary.dll"/>
<include name="Libraries\nunit.framework.dll"/>
</references>
<sources>
<include name="Test\**\*.cs" />
</sources>
</csc>
</target>
<target name="test" depends="build_tests">
<nunit2>
<formatter type="Plain" />
<test assemblyname="Target\Test.dll" />
</nunit2>
</target>
有一些版本的問題,我需要知道的? Test.dll在NUnit GUI中運行良好。
測試dll是絕對被人發現,因爲如果我移動時,我收到以下錯誤:
Failure executing test(s). If you assembly is not build using NUnit 2.2.8.0... Could not load file or assembly 'Test' or one of its dependencies...
我將不勝感激,如果任何人都可以點我在正確的方向或描述他們有一個與之相似的情況遇到。
編輯我已經嘗試過NAnt 0.86 beta 1,並且會出現同樣的問題。
謝謝,它有助於瞭解通常的解決方法! – 2012-05-29 17:53:26