Open joshbartley opened 4 years ago
Note from triage: link to the .NET tools documentation rather than documenting individual options here.
Does not work when you have multiple nuget sources (feeds) and one fails: dotnet tool install --global dotnet-ef
Works: dotnet tool install --global dotnet-ef --ignore-failed-sources
Would be really helpful to mention that as common issue in the documentation. Took me quite some time to figure out why this fails.
Related error messages: Response status code does not indicate success: 401 (Unauthorized). The tool package could not be restored.
The link in the error message (https://aka.ms/failure-installing-tool) actually leads to a solution but can be missed easily.
Related documention: https://docs.microsoft.com/en-us/ef/core/cli/dotnet https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/cli/dotnet.md
When attempting to install the global EF tool, the cli uses Nuget to pull down the tool and if you have multiple nuget sources, and/or if one of them fail to respond with the package the installation fails. The fix is to add
--ignore-failed-sources
to the command. This argument is only referenced in thedotnet restore
documentation and issues on Github.Adding a Note for the documentation that if a user has multiple feeds and received the
dotnet : The tool package could not be restored.
to include the argument--ignore-failed-sources
would help to prevent searching the error message to resolve the issue.Argument Issue Reference https://github.com/dotnet/sdk/issues/9886
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.