我们有一个 .NET 解决方案,我正试图在我们的新 CI 环境 TeamCity 中运行它。
解决方案构建并运行,并且所有单元测试都在我们的开发机器上运行(并非全部通过,但那是另一回事)。
它也可以在 CI 服务器上正确构建,但是在运行 MSTest 配置时,它会失败,并显示如下消息:
Unable to load the test container '[one of my test assemblies]' or one of its dependencies. Error details: System.IO.FileNotFoundException: Could not load file or assembly '[one of my assemblies]' or one of its dependencies. The system cannot find the file specified.
好吧,我的程序集已构建并可用,所以这不太可能。在我的本地开发机器上,我可以使用 procmon 或类似工具获得更多详细信息,以查看依赖链在哪里被破坏,但我不确定如何针对远程服务器执行此操作。
如何找出我的 CI 服务器缺少什么来完成它的工作?我可以启用一些日志记录吗?
最佳答案
当您尝试运行测试时,听起来工作目录是错误的。
您的构建和单元测试步骤是否在同一个“构建配置”中?
关于c# - 对 TeamCity 上的程序集依赖链问题进行故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25142046/