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
--no-restore false isn't honored in the dotnet build and other commands
#23297
Comments
Does not occur. |
|
Can the option instead be changed to not accept any argument? That would match the |
This did not restore NuGet packages because |
|
ah, you're exactly right. I blame double-negatives and allergies. I'll get the description updated with your change. |
|
But then I don't understand how your screen shot in #23297 (comment) shows package restore taking place anyway. Is that because of a difference between .NET SDK versions? |
|
I think that's due to stuff happening in the build of the SDK project I chose to build itself; I chose a bad test sample. Your example with a newly-scaffolded project is a better example. |
|
@baronfel I would like to work on this. Please assign me to this item. |
|
#23297 (comment) has not been answered. |
|
I don't see a need to let The only reason for such a feature would be if a So my preference would be:
|

Describe the bug
The
--no-restoreflag technically accepts a boolean argument,--no-restore true/--no-restore false. Thedotnet buildcommand (and likely several others), only check for the existence of the option, not what the actual value is, when passingnoRestoreto other parts of the code. An example of this can be found here. We should change this pattern to useGetValueForOption<T>instead.To Reproduce
In any project, run
dotnet build --no-restore false. Note that a restore does not occur.Exceptions (if any)
None
Further technical details
The text was updated successfully, but these errors were encountered: