Skip to content

Change default behavior for the commands that require nuget.org #44312

Closed
@marcpopMSFT

Description

We have nuget.org hardcoded into a couple of our commands. Those commands are not common but it's possible a customer could end up running them in a scenario where they don't have nuget.org configured in their nuget.config and don't want us skipping past that configuration.

I would argue a better experience would be a customer runs dotnet tool search and we report back that the command is only supported on nuget.org and the customer should update their nuget configuration if they want to continue. That seems more reasonable than doing the network query when their configuration doesn't include it.

sdk/src/Cli/dotnet/NugetSearch/NugetToolSearchApiRequest.cs at main · dotnet/sdk (github.com)
This appears to always hit nuget.org when running a tool search.

sdk/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs at main · dotnet/sdk (github.com)
This seems to be the same command as the below one depending on whether it's a local package or not.
if (localPackage != null && packageTemplates != null)

sdk/src/Cli/Microsoft.TemplateEngine.Cli/NuGet/NugetApiManager.cs at main · dotnet/sdk (github.com)
This one will add nuget.org if the sourcefeed passed in is null. It's called from DisplayTemplatePackageMetadata which is used in the "dotnet new details command".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions