NuGet/Home

RestoreLockedMode=true & RestoreForceEvaluate=true should error

Geschlossen

#8.222 geöffnet am 13.06.2019

 (6 Kommentare) (1 Reaktion) (1 zugewiesene Person)HTML (292 Forks)batch import
Area:ErrorHandlingArea:RestoreRepeatableBuildCategory:Quality WeekFunctionality:RestorePriority:2Type:Bughelp wanted

Repository-Metriken

Stars
 (1.459 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 464T 23h) (1 gemergte PR in 30 T)

Beschreibung

Currently that's not the case.

Repro steps

  1. dotnet new classlib
  2. Enable lock file
  3. dotnet restore (generate lock file).
  4. dotnet restore /p:LockedMode="true"
  5. dotnet restore /p:LockedMode="true" /p:RestoreForceEvaluate="true"

The last one should fail, as the instructions do not make sense. From skimming the code, RestoreForceEvaluate takes precedence.

https://github.com/NuGet/NuGet.Client/blob/bdcec93681afdd1f5cd553af07414a3b3d9a866c/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs#L462

//cc @anangaur It's a trivial fix, so prioritize if you see a need for it.

Contributor Guide