对于某些NUnit Test项目,Teamcity不是DLL [英] Teamcity not DLL's for some NUnit Test projects
问题描述
通过Teamcity 5运行Moq测试时出现此错误
I get this error when running my Moq tests through Teamcity 5
测试失败. System.IO.FileNotFoundException: 无法加载文件或程序集'Moq, 版本= 3.1.416.3,文化=中性, PublicKeyToken = 69f491c39445e920'或 它的依赖项之一.系统 找不到指定的文件.在 MyCode.Tests.SomeHandlerTests.Setup()
Test(s) failed. System.IO.FileNotFoundException : Could not load file or assembly 'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The system cannot find the file specified. at MyCode.Tests.SomeHandlerTests.Setup()
测试在我的本地计算机上运行良好;他们只是在构建服务器上失败.
The tests run fine on my local; they just fail on the build server.
我确保程序集在Bin中(现在可以肯定地通过RDP对其进行查看).
I made sure the assemblies are in the Bin (looking at them now over RDP just be double sure).
推荐答案
所以问题在于nunit设置下的Test DLL搜索路径
So the issue was to do with the Test DLL search path under the nunit settings
是:
.. \ Tests \ ** \ * Test * .dll
..\Tests\**\*Test*.dll
但现在是:
.. \ Tests \ * \ bin \ Debug \ * Test * .dll
..\Tests\*\bin\Debug\*Test*.dll
一切都很好
更新
http://confluence.jetbrains.com/display/TCD8/NUnit
您可以使用此模式
** \ *.dll
**\*.dll
只要您在请勿从以下位置运行测试" 字段中添加此模式
as long as you add this pattern in the "Do not run tests from" field
** \ obj \ ** \ *.dll
**\obj\**\*.dll
这篇关于对于某些NUnit Test项目,Teamcity不是DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!