我刚把一个自动化测试项目添加到我的C#解决方案中并提交到了我的构建服务器。
当使用MSBuild (.NET Framework 3.5)运行构建脚本时,它会给我返回几个错误(例如以下错误):
**cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
**.cs(21,17): error CS0246: The type or namespace name 'TestContext' could not be found (are you missing a using directive or an assembly reference?)
**.cs(73,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
**.cs(73,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
**.cs(14,6): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?)
**.cs(14,6): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?)
当我在我的电脑上运行.NET 3.5 msbuild时,它能够正确构建。
构建服务器上没有安装.NET 4.0,也不能升级。有人能否建议是什么原因导致这种差异,并提供解决方法使测试项目成功构建?
感谢。