.dll引用在调试模式下正确加载到c#项目中,但在Release中找不到名称空间

Bra*_*don 6 c# dll teamcity nunit

我正在为我的公司设置CI服务器并集成单元测试.我选择使用TeamCity和NUnit,因为他们过去曾为我工作过的其他组织工作得很好.

我已经启动并运行了TeamCity,我现在只创建了一个测试单元测试项目,因此我可以验证TeamCity是否正确处理我的NUnit配置.在我的项目中,我添加了对nunit.framework.dll的引用,该引用位于我的解决方案根目录下的文件夹中.当我提交测试解决方案时,这是我从TeamCity中的构建步骤获得的输出:

[10:45:35][Csc] UnitTesting.cs(5, 7): error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)

[10:45:35][Csc] UnitTesting.cs(16, 10): error CS0246: The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?)

[10:45:35][Csc] UnitTesting.cs(16, 10): error CS0246: The type or namespace name 'TestAttribute' could not be found (are you missing a using directive or an assembly reference?)

[10:45:35][Csc] UnitTesting.cs(13, 6): error CS0246: The type or namespace name 'TestFixture' could not be found (are you missing a using directive or an assembly reference?)

[10:45:35][Csc] UnitTesting.cs(13, 6): error CS0246: The type or namespace name 'TestFixtureAttribute' could not be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)

当我回到IDE时,我能够构建解决方案而不会看到这些错误消息.直到我切换到Release配置.一旦我切换配置并构建了解决方案,我在IDE中获得了来自TeamCity的相同消息.

我尝试再次将.dll文件添加到我的项目中,但Visual Studio抱怨该引用已存在,并阻止我再次添加它.

是什么赋予了?

Bra*_*don 12

几乎所发生的事情是:Visual Studio忘记了发生的事情并且无缘无故地与现实失去联系,并且不知道在哪里寻找.dll.我不知道为什么它只发生在Release配置中,但我删除了引用并重新添加它,一切都很好.