简体   繁体   中英

.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:

##[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.

The full log file of the build stage is available here: LINK

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

According to the error messages in your link, like following:

The type or namespace name 'DataAnnotations' does not exist in the namespace '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.

Check the details info from .NET Core task

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM