question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot build in VSTS - Dotnet command failed with non-zero exit code

See original GitHub issue

Without making any changes to our project files, just regular code update, our builds started to fail from this monday - 21/08/2017. During the build, in the log, we get the following error at the Restore step:

Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1

And

Dotnet command failed with non-zero exit code on the following projects : d:\a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj

We have not made any changes to the Tests csproj. We only tried to remove the test project just to see if it builds but then it started to throw the same error for the main web project. We use hosted2017 agent. Our .net core project is 1.1.1.

Any ideas how to solve it?

This is the output from our .net info step:

2017-08-23T08:01:05.6316895Z ##[section]Starting: Info 2017-08-23T08:01:05.6596901Z ============================================================================== 2017-08-23T08:01:05.6596901Z Task : .NET Core 2017-08-23T08:01:05.6606897Z Description : Build, test and publish using dotnet core command-line. 2017-08-23T08:01:05.6606897Z Version : 1.0.2 2017-08-23T08:01:05.6606897Z Author : Microsoft Corporation 2017-08-23T08:01:05.6606897Z Help : More Information 2017-08-23T08:01:05.6606897Z ============================================================================== 2017-08-23T08:01:07.3557124Z [command]“C:\Program Files\dotnet\dotnet.exe” --info d:\a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj 2017-08-23T08:01:09.3707368Z .NET Command Line Tools (2.0.0) 2017-08-23T08:01:09.3807382Z 2017-08-23T08:01:09.3807382Z Product Information: 2017-08-23T08:01:09.3857379Z Version: 2.0.0 2017-08-23T08:01:09.4357389Z Commit SHA-1 hash: cdcd1928c9 2017-08-23T08:01:09.4357389Z 2017-08-23T08:01:09.4387377Z Runtime Environment: 2017-08-23T08:01:09.4387377Z OS Name: Windows 2017-08-23T08:01:09.4387377Z OS Version: 10.0.14393 2017-08-23T08:01:09.4707381Z OS Platform: Windows 2017-08-23T08:01:09.5137399Z RID: win10-x64 2017-08-23T08:01:09.5137399Z Base Path: C:\Program Files\dotnet\sdk\2.0.0
2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z Microsoft .NET Core Shared Framework Host 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z Version : 2.0.0 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5137399Z 2017-08-23T08:01:09.5147402Z [command]“C:\Program Files\dotnet\dotnet.exe” --info d:\a\1\s\BD.YRD.Web\BD.YRD.Web.csproj 2017-08-23T08:01:09.5147402Z .NET Command Line Tools (2.0.0) 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z Product Information: 2017-08-23T08:01:09.5147402Z Version: 2.0.0 2017-08-23T08:01:09.5147402Z Commit SHA-1 hash: cdcd1928c9 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z Runtime Environment: 2017-08-23T08:01:09.5147402Z OS Name: Windows 2017-08-23T08:01:09.5147402Z OS Version: 10.0.14393 2017-08-23T08:01:09.5147402Z OS Platform: Windows 2017-08-23T08:01:09.5147402Z RID: win10-x64 2017-08-23T08:01:09.5147402Z Base Path: C:\Program Files\dotnet\sdk\2.0.0
2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z Microsoft .NET Core Shared Framework Host 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z Version : 2.0.0 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5147402Z 2017-08-23T08:01:09.5387414Z ##[section]Finishing: Info

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:25 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
wli3commented, Aug 24, 2017

@jakubsvobodacz i think he means @microsoft.com

1reaction
ghostcommented, Sep 13, 2017

@trbngr Thanks. This worked for me.

For others, to be more specific, comment out:

<DotNetCliToolReference Include="BundlerMinifier.Core" Version="X.X.XXX" />

The PackageReference can stay.

Read more comments on GitHub >

github_iconTop Results From Across the Web

build - Dotnet command failed with non-zero exit code on the ...
In my case, my project had the line <IsPackable>false</IsPackable> in the csproj file, which caused the Pipeline job to fail in DevOps when...
Read more >
Visual Studio Developer Community
The build runs successfully for my test cases when they are all true. ... ##[error]Dotnet command failed with non-zero exit code on the...
Read more >
[error]Dotnet command failed with non-zero exit code on the ...
1. Check the project name in the error carefully. Chances are its not actually in your solution .sln ... and wouldn't build if...
Read more >
4.3 - Couple of issues when building source code on Azure ...
Workaround: REMOVE Avalara plugin from solution, and rebuild. 2) Azure DevOps PUBLISH Task fails with error NU1605: Detected package downgrade: System.Net.
Read more >
Azure devops tests fail with very little clue - Selfelected
To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found