Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
RestoreForceEvaluate overrides RestoreLockedMode; the packages lock file will be re-evaluated and regenerated, and locked mode is ignored.
Issue
Both RestoreLockedMode and RestoreForceEvaluate are enabled for the restore, but these options are contradictory:
RestoreLockedModerequires thepackages.lock.jsonfile to remain unchanged, and fails the restore if the resolved package dependencies differ from the lock file.RestoreForceEvaluateforces NuGet to re-evaluate the package dependencies and regenerate the lock file on every restore.
When both are set, RestoreForceEvaluate takes precedence: the lock file is re-evaluated and regenerated, and the requested locked mode is ignored.
This warning is raised so that the ignored locked mode is not silent.
Solution
Enable only one of these properties, based on your intent:
To guarantee repeatable restores (for example, in CI/CD scenarios), keep
RestoreLockedModeenabled and stop settingRestoreForceEvaluate. For example, remove the--force-evaluateoption (or-p:RestoreForceEvaluate=true) from your restore command:dotnet restore --locked-modeTo intentionally re-evaluate floating versions and regenerate the lock file, keep
RestoreForceEvaluateenabled and stop settingRestoreLockedMode:dotnet restore --force-evaluate
Note
This warning is raised by default starting with the .NET 11 SDK (SdkAnalysisLevel value 11.0.100 or higher).
You can change the SdkAnalysisLevel property to control this behavior.