【问题标题】:Why i cannot build the test project in Msbuild Teamcity using the project solution file?为什么我无法使用项目解决方案文件在 Msbuild Teamcity 中构建测试项目?
【发布时间】:2020-09-06 20:30:01
【问题描述】:
UnitTest1.cs(131,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)

16:42:40 UnitTest1.cs(131,10):错误 CS0246:找不到类型或命名空间名称“TestMethod”(您是否缺少 using 指令或程序集引用?)

16:42:40 UnitTest1.cs(144,10):错误 CS0246:找不到类型或命名空间名称“TestMethodAttribute”(您是否缺少 using 指令或程序集引用?)

【问题讨论】:

  • 您是否使用路径C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe 来构建您的项目?如果没有,请试试这个。
  • 我正在构建服务器中运行
  • 你的项目在本地构建成功了吗?

标签: c# visual-studio build msbuild teamcity


【解决方案1】:

为什么我不能在 Msbuild Teamcity 中使用 项目解决方案文件?

首先,您应该确保您可以在本地成功构建您的测试项目。

然后,请遵循以下建议:

建议

首先,在Teamcity 9.1.5之前,您应该在构建代理上安装Microsoft Visual Studio edition,并确保您安装了正确的版本。请参阅this official document

由于TeamCity 9.1.5,Visual Studio 测试运行程序支持安装在代理计算机上的 Visual Studio 测试代理(不再需要 Microsoft Visual Studio)。可以参考this link

第二,您应该在构建步骤之前在 VCS 中恢复 nuget 包。

this

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-05
    • 2016-04-26
    • 2017-12-23
    • 1970-01-01
    • 1970-01-01
    • 2012-12-04
    • 1970-01-01
    相关资源
    最近更新 更多