“无法加载文件或程序集"使用团队城市建造时

2

本文介绍了“无法加载文件或程序集"使用团队城市建造时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我在 Team City (8.0.4) 构建服务器上遇到了单元测试问题 - 代码构建 &通过 Resharper 和 nCrunch 在本地运行所有测试.

I'm running into an issue with unit tests on our Team City (8.0.4) build server - the code builds & runs all tests locally via Resharper and nCrunch.

但是在服务器上运行时,我得到以下错误,即使 Unity 程序集与单元测试程序集存在于同一目录中,并且在单元测试程序集中被引用.

But when running on the server I get the following error, even though the Unity assembly exists in the same directory as the unit test assembly, and is referenced in the unit test assembly.

SetUp 方法失败.SetUp:System.IO.FileNotFoundException:无法加载文件或程序集Microsoft.Practices.Unity,版本=2.0.414.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"或其依赖项之一.该系统找不到指定的文件.在 XXXX.Unity.UnityContainerAdapter..ctor()在 XXXX.GraphExtensionsTests..ctor() 在 c:TeamCityV7Agent-1workf02f7e27c0bedfa2XXXXGraph.TestsExtensionsGraphExtensionsTests.cs:line 44

SetUp method failed. SetUp : System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. at XXXX.Unity.UnityContainerAdapter..ctor() at XXXX.GraphExtensionsTests..ctor() in c:TeamCityV7Agent-1workf02f7e27c0bedfa2XXXXGraph.TestsExtensionsGraphExtensionsTests.cs:line 44

我已确认 Microsoft.Practices.Unity 的副本是正确的版本.

I've confirmed the copy of Microsoft.Practices.Unity is the correct version.

我还确认程序集是使用完整版框架构建的,而不是使用客户端配置文件.

I've also confirmed the assemblies are built using the full version of the framework - not using client profile.

您知道 Team City 可能会失败的原因吗?

Any ideas why Team City might be failing?

推荐答案

检查您用来定位测试程序集的模式.我在另一个库中遇到了类似的问题,结果发现模式是在 binRelease 和 objRelease 下找到测试程序集;obj 文件夹不包含项目引用的所有程序集,实际上只是编译器的临时文件夹.

Check the pattern you're using to locate your test assemblies. I had a similar problem with another library and it turns out the pattern was finding the test assembly under binRelease and objRelease; the obj folder doesn't contain all the assemblies referenced by the project and is really just a scratch folder for the compiler.

这篇关于“无法加载文件或程序集"使用团队城市建造时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14

具有未知类型的 CreateDelegate
CreateDelegate with unknown types(具有未知类型的 CreateDelegate)...
2023-11-11 C#/.NET开发问题
5

Func<T>.BeginInvoke 使用线程池吗?
Does Funclt;Tgt;.BeginInvoke use the ThreadPool?(Funclt;Tgt;.BeginInvoke 使用线程池吗?)...
2023-11-11 C#/.NET开发问题
6

如何为具有空目标的实例方法创建委托?
How to create a delegate to an instance method with a null target?(如何为具有空目标的实例方法创建委托?)...
2023-11-11 C#/.NET开发问题
6