diff --git a/docs/core/tools/dotnet-package-update.md b/docs/core/tools/dotnet-package-update.md new file mode 100644 index 0000000000000..53007081f211d --- /dev/null +++ b/docs/core/tools/dotnet-package-update.md @@ -0,0 +1,117 @@ +--- +title: dotnet package update command +description: Update PackageReferences in a project. +author: zivkan +ms.date: 10/03/2025 +--- +# dotnet package update + +**This article applies to:** ✔️ .NET 10 SDK and later versions + +## Name + +`dotnet package update` - Update referenced packages in a project. + +## Synopsis + +```dotnetcli +dotnet package update [...] + [--interactive] [--project ] + [--verbosity ] [--vulnerable] + +dotnet package update -h|--help +``` + +## Description + +The `dotnet package update` command updates packages used by projects. +If [NuGetAudit](/nuget/concepts/auditing-packages) is enabled, it can also attempt to automatically update update packages with known vulnerabilities to fixed versions. + +### Warnings as Errors + +`dotnet package update` does implicit restores to check if the resulting package graph is free of errors. +Using `--vulnerable` also does an implicit restore to find NuGetAudit warnings. +However, if your project uses `WarningsAsErrors` or `TreatWarningsAsErrors`, NuGet's restore warnings can cause restore to fail, preventing the update from completing. + +We recommend taking advantage of MSBuild conditions and environment variables as a workaround until [this feature request](https://github.com/NuGet/Home/issues/14311) is implemented. +For example, set `