Home: Restore fails with NU1004 after running nuget restore with -ForceEvaluate

Created on 11 Dec 2020  路  2Comments  路  Source: NuGet/Home

Details about Problem

This has some of the same symptoms as https://github.com/NuGet/Home/issues/9332 but may not be the same issue; it happened under different circumstances and this time I was able to assemble a small solution that can reproduce the problem.

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): NuGet.exe

NuGet version (x.x.x.xxx): 5.8.0.6930

dotnet.exe --version (if appropriate): n/a

VS version (if appropriate): 16.8.3

OS version (i.e. win10 v1607 (14393.321)): Windows 10

Worked before? If so, with which NuGet version: 5.3?

Detailed repro steps so we can see the same problem

  1. Unzip attached Repro.zip archive

  2. Restore the repro solution with nuget.exe and -ForceEvaluate => should succeed

nuget restore -ForceEvaluate Repro.sln
  1. Restore the repro solution with nuget.exe and -LockedMode => should FAIL!
nuget restore -LockedMode Repro.sln

Verbose Logs

NU1004: The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.
NU1004: The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.

Sample Solution

Repro.zip

RestoreRepeatableBuild Restore 2 NuGet.exe Duplicate Bug

All 2 comments

I can reproduce this issue following the repro steps.

Was this page helpful?
0 / 5 - 0 ratings