我正在为公司建立一个CI服务器并集成单元测试。我选择使用TeamCity和NUnit,因为它们在我以前工作的其他组织中表现良好。目前,我已经成功地安装了TeamCity,并且创建了一个单元测试项目来验证TeamCity是否正确处理了我的NUnit配置。在我的项目中,我添加了对nunit.framework.dll的引用,它位于解决方案根目录下的一个文件夹中。当我提交解决方案进行测试时,我从TeamCity的构建步骤中得到了以下输出:
当我回到我的IDE时,我能够构建解决方案,而不会看到那些错误消息。直到我切换到发布配置。当我切换配置并构建解决方案时,我从TeamCity获得的相同消息在我的IDE中出现了。
我尝试再次将.dll文件添加到我的项目中,但Visual Studio抱怨参考已经存在,并阻止我再次添加它。
怎么回事?
[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?)
当我回到我的IDE时,我能够构建解决方案,而不会看到那些错误消息。直到我切换到发布配置。当我切换配置并构建解决方案时,我从TeamCity获得的相同消息在我的IDE中出现了。
我尝试再次将.dll文件添加到我的项目中,但Visual Studio抱怨参考已经存在,并阻止我再次添加它。
怎么回事?