-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not automatically add nuget.org as a package source when it is absent from nuget.config Fixes #44312 #45410
base: release/9.0.2xx
Are you sure you want to change the base?
Conversation
<data name="NeedNuGetInConfig" xml:space="preserve"> | ||
<value>The 'dotnet tool search' command unconditionally accesses nuget.org to find tools, but it is not present in your nuget.config. Add it to run this command.</value> | ||
<comment>Do not translate 'dotnet tool search' or 'nuget.config'</comment> | ||
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be providing the command for them to add it? I always find it strange to give the user a message to tell them to do something, but not telling them how to do it. Maybe @baronfel has a suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trick is to make sure that we remember to update the message in case the command needed to run ever changes, otherwise we'd be giving incorrect instructions which is just as bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be great if we could just have a command express itself as a string so you could reference it directly in the message? Then, if the command itself changes, the string would update. 😊 (cough my JSON-based parser could do this natively cough)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, I think this one we could probably do without worrying too much about it changing out from under us, as it's the first example in how to use dotnet nuget add source:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source#examples
I'll add it provisionally, and if we ultimately decide against it, I can take it out again.
Fixes #44312
If a user doesn't have nuget.org as a source in their nuget.config, we shouldn't assume they want it. This sends a message for dotnet tool search if nuget.org is absent, as it is needed for dotnet tool search to work properly, instead of running the command. For other commands like dotnet new details, it does not automatically add nuget.org to the sources.
(Neither command implicitly went to nuget.org.)