NuGet Error NU1005 (original) (raw)

Scenario 1

Invalid restore input where RestorePackagesWithLockFile property is set to false but a packages lock file exists at C:\SourceCode\ContosoProject\Contoso.Library\packages.lock.json

Issue

There are 2 opt-in methods the lock file functionality, by setting the RestorePackagesWithLockFile property, or create a packages.lock.json next to the project file, and they are conflicting.

Solution

Scenario 2

RestoreForceEvaluate should not be used with RestoreLockedMode in the same command.

Issue

The commands are contrary to each other. RestoreForceEvaluate forces restore to reevaluate the dependencies generating a new lock file, while RestoreLockedMode prevents updating the lock file.

Solution

Consult the recommendations in the error message and do one of the following: