dotnet restore exit code reports success when actually failed
See original GitHub issueRepro is simple. Try to restore a package that doesnt exist:
aaronla@aaronla-rabbit:MyRepo$ dotnet restore
X:\MyRepo\dirs.proj : error : Unable to find package Microsoft.Build.Traversal with version (= 2.999.1)
X:\MyRepo\dirs.proj : error : - Found 24 version(s) in MyCustomFeedOne [ Nearest version: 3.0.0 ]
X:\MyRepo\dirs.proj : error : - Found 0 version(s) in MyCustomFeedTwo
aaronla@aaronla-rabbit:MyRepo$ echo %ERRORLEVEL%
0
expected: %ERRORLEVEL%==1
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
asp.net core - dotnet restore fails from Docker container
The actual error seems to be: Unable to load the service index for source https://api.nuget.org/v3/index.json.
Read more >dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >Dotnet test/restore fail in VSTS
This problem started occurring suddenly on builds that previously built fine. This is the error I am receiving:
Read more >ERROR: Job failed: exit code 1 (#3104) · Issues - GitLab.org
Summary. Script executed with success, but job fail. Steps to reproduce. Here is my attempt, you can check the error, an error message ......
Read more >Dotnet build quiet. 18. In this article. For more information, see ...
DESCRIPTION Installs dotnet cli. This will fail against authenticated feeds, even if you ran a successful dotnet restore in an earlier step, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think so. There are several references online to NuGet restore returning 1 like: https://github.com/microsoft/azure-pipelines-tasks/issues/2747
It might be more subtle, though, like NuGet restore only returns 0 if everything is proper, even if it can’t find the file, and 1 if there’s an error that prevented it from finishing its search.
16.10 preview 3 for MSBuild. I’m not sure which version exactly that corresponds to.
And I think you’re right that it should be closed.