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.

dotnet restore exit code reports success when actually failed

See original GitHub issue

Repro 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:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Forgindcommented, Feb 26, 2021

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.

0reactions
Forgindcommented, Apr 14, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

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