对于某些 NUnit 测试项目,Teamcity 不是 DLL

发布于 2024-09-18 22:33:33 字数 336 浏览 2 评论 0原文

通过 Teamcity 5 运行起订量测试时出现此错误

测试失败。 System.IO.FileNotFoundException: 无法加载文件或程序集“Moq, 版本=3.1.416.3,文化=中立, PublicKeyToken=69f491c39445e920' 或 它的依赖项之一。系统 找不到指定的文件。在 MyCode.Tests.SomeHandlerTests.Setup()

测试在我的本地运行良好;他们只是在构建服务器上失败了。

我确保程序集位于 Bin 中(现在通过 RDP 查看它们只是双重确定)。

I get this error when running my Moq tests through Teamcity 5

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.

I made sure the assemblies are in the Bin (looking at them now over RDP just be double sure).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人间不值得 2024-09-25 22:33:33

所以问题与 nunit 设置下的 Test DLL 搜索路径有关

..\Tests\**\*Test*.dll

但现在是:

..\Tests\*\bin\Debug\*Test*.dll

并且一切正常

更新

http://confluence.jetbrains.com/display/TCD8/NUnit

您可以使用此模式

**\*.dll

只要您在“不要运行测试”字段中添加此模式即可

**\obj\**\*.dll

So the issue was to do with the Test DLL search path under the nunit settings

It was:

..\Tests\**\*Test*.dll

But is now:

..\Tests\*\bin\Debug\*Test*.dll

And things work nicely

UPDATE

http://confluence.jetbrains.com/display/TCD8/NUnit

You can use this pattern

**\*.dll

as long as you add this pattern in the "Do not run tests from" field

**\obj\**\*.dll

深府石板幽径 2024-09-25 22:33:33

我遇到了类似的问题,但发现我的 2 个测试项目之间的起订量版本不同。

我遇到的问题是没有正确的版本。

只需

Update-Package Moq

从包管理器命令行执行

I had a similar issue, but found that I had different version's of Moq between my 2 Test projects.

The issue that I had was that the correct version was not available.

Just do

Update-Package Moq

From the Package Manager command line

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文