Skip to content

Commit 5f4514e

Browse files
authored
Document lock files and pruning (#3461)
1 parent 68bfa76 commit 5f4514e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/consume-packages/Package-References-in-Project-Files.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ You can also set this conditional MSBuild property in your project file:
366366

367367
If locked mode is `true`, restore will either restore the exact packages as listed in the lock file or fail if you updated the defined package dependencies for the project after lock file was created.
368368

369+
#### Lock files and PrunePackageReference
370+
371+
[PrunePackageReference](#prunepackagereference) changes the dependencies of a project, by removing unnecessary transitive packages.
372+
While removing these packages should not have an impact at runtime, it will affect lock files.
373+
If you enable pruning for an existing project, whenever the lock file gets regenerated, it may lead to fewer packages than before pruning.
374+
The lock file up to date check that powers locked mode is pruning aware, which means if you enabled pruning on a project, the check will account for packages that are pruned.
375+
However the next time the lock file is regenerated, it will exclude the pruned packages, so you may see a diff that's larger than usual.
376+
369377
### Make lock file part of your source repository
370378

371379
If you are building an application, an executable, and the project in question is at the start of the dependency chain, then do check in the lock file to the source code repository so that NuGet can make use of it during restore.

0 commit comments

Comments
 (0)