【问题标题】:.Net Core solutions build locally, but fails build on Azure DevOPS pipeline.Net Core 解决方案在本地构建,但在 Azure DevOPS 管道上构建失败
【发布时间】:2019-08-03 05:50:09
【问题描述】:

我的 .Net Core 2.1 应用程序在我的本地计算机上成功构建,但是在我的 Azure DevOPS 管道上,它在构建阶段失败并出现以下错误:

##[error]Error: C:\hostedtoolcache\windows\dncs\2.1.500\x64\dotnet.exe failed with return code: 1
##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\API\API.csproj,D:\a\1\s\AuthCore\AuthCore.csproj,D:\a\1\s\DomainModel\DomainModel.csproj,D:\a\1\s\Repo\Repo.csproj

我在管道中的还原步骤之前添加了 .Net Core SDK 安装程序(并尝试了各种版本),但每次都以相同的方式失败。

构建阶段的完整日志文件可在此处获得:LINK

【问题讨论】:

  • 您的链接显示:file.io 404 Page not found
  • 我更正了链接。谢谢。

标签: build .net-core azure-pipelines


【解决方案1】:

.Net Core 解决方案在本地构建,但在 Azure DevOPS 管道上构建失败

根据您链接中的错误消息,如下所示:

类型或命名空间名称“DataAnnotations”不存在于 命名空间'System.ComponentModel'

您在构建项目/解决方案时似乎缺少参考。因此,如果您使用 nuget 添加这些引用,您可能还需要添加一个 nuget restore 任务来恢复这些 nuget 包。

查看.NET Core task的详细信息

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-28
    • 2021-11-26
    • 1970-01-01
    • 2020-11-22
    • 2016-10-24
    • 2015-08-08
    • 2019-08-18
    • 2022-01-16
    相关资源
    最近更新 更多