From 7f4dda31b8a49bbd41768c2bde2a37084e13c838 Mon Sep 17 00:00:00 2001 From: Andy Zivkovic Date: Fri, 3 Oct 2025 14:54:48 +0930 Subject: [PATCH] Initial docs for dotnet package update --- docs/core/tools/dotnet-package-update.md | 117 +++++++++++++++++++++++ docs/core/tools/index.md | 2 +- docs/navigate/tools-diagnostics/toc.yml | 2 + 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 docs/core/tools/dotnet-package-update.md 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 `