简体   繁体   English

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

[英].Net Core solutions build locally, but fails build on Azure DevOPS pipeline

My .Net Core 2.1 app builds successfully on my local machine, however on my Azure DevOPS pipeline, it fails in the build stage with the following error: 我的.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

I have added the .Net Core SDK installer before the restore step in the pipeline (and tried various versions) but it fails the same way every time. 我已经在管道中的还原步骤之前添加了.Net Core SDK安装程序(并尝试了各种版本),但是每次都以相同的方式失败。

The full log file of the build stage is available here: LINK 可以在此处找到构建阶段的完整日志文件: LINK

.Net Core solutions build locally, but fails build on Azure DevOPS pipeline .Net Core解决方案在本地构建,但无法在Azure DevOPS管道上构建

According to the error messages in your link, like following: 根据您链接中的错误消息,如下所示:

The type or namespace name 'DataAnnotations' does not exist in the namespace 'System.ComponentModel' 类型或名称空间名称“ DataAnnotations”在名称空间“ System.ComponentModel”中不存在

It seems you are missing the references when you build the project/solution. 似乎在构建项目/解决方案时缺少参考。 So, if you add those references with nuget, you may need also add a nuget restore task to restore those nuget packages. 因此,如果您使用nuget添加这些引用,则可能还需要添加nuget restore任务以还原那些nuget软件包。

Check the details info from .NET Core task .NET Core任务检查详细信息

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps Pipeline Build 在 GAC 中丢失 DLL 引用失败 - Azure DevOps Pipeline Build fails missing DLL reference in GAC flutter 使用 azure devops 构建管道 - flutter build pipeline with azure devops 核心 ASP.NET 项目 Azure 构建管道 - Core ASP.NET Project Azure Build Pipeline Azure DevOps CICD 构建管道因错误而失败:未找到指定的命令或文件 - Azure DevOps CICD build pipeline fails with error: specified command or file was not found Azure Devops CI 管道未显示在代理任务下构建项目的 Net 选项 - Azure Devops CI pipeline not showing .Net option to build a project under Agent tasks 在 Azure DevOps 中,是否可以使用 API 递归地枚举子管道构建工件? - In Azure DevOps, is it possible to enumerate children pipeline build artifacts recursively with API? 在离线服务器上构建 Azure Devops Pipeline - NuGet 包? - Azure Devops Pipeline build on OFFLINE server - NuGet packages? Azure DevOps .NET Core 构建和发布不会保留给定的应用程序版本 - Azure DevOps .NET Core build and publish doesn't keep given application version 尝试在 Azure DevOps Pipeline 中构建时未找到项目文件 - Project File Not Found while attempting build in Azure DevOps Pipeline 是否可以在Azure DevOps上的构建管道中下载文件? - Is it possible to download files during the build pipeline on Azure DevOps?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM