From 2db1dcd10ccae81dc8d50f929ae10a2ef34c1601 Mon Sep 17 00:00:00 2001 From: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com> Date: Thu, 21 Aug 2025 03:07:14 -0700 Subject: [PATCH] Improve NuGet Dependency Version Validation via dotnet restore (#40646) ### NuGet Package Management Improvements: * This pull request includes updates to improve NuGet package management and dependency versions. ### Example problem of the new ps1 change, and fixed in this PR Updated the version of `NLog` from `5.0.4` to `5.2.8`, with the error message: error NU1605: Warning As Error: Detected package downgrade: NLog from 5.2.8 to 5.0.4. Reference the package directly from the pr oject to select a different version. Microsoft.PowerToys.Run.Plugin.History -> Wox.Plugin -> NLog.Extensions.Logging 5.3.8 -> NLog (>= 5.2.8) Microsoft.PowerToys.Run.Plugin.History -> Wox.Plugin -> NLog (>= 5.0.4) --- .github/actions/spell-check/expect.txt | 1 + .pipelines/verifyNugetPackages.ps1 | 9 +++++++++ Directory.Packages.props | 3 ++- NOTICE.md | 1 + src/modules/launcher/Wox.Plugin/Wox.Plugin.csproj | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index c275d6725f..004d9f4269 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -1118,6 +1118,7 @@ NOTSRCCOPY NOTSRCERASE notwindows NOTXORPEN +nowarn NOZORDER NPH npmjs diff --git a/.pipelines/verifyNugetPackages.ps1 b/.pipelines/verifyNugetPackages.ps1 index 54d0137121..c7cebbd383 100644 --- a/.pipelines/verifyNugetPackages.ps1 +++ b/.pipelines/verifyNugetPackages.ps1 @@ -21,4 +21,13 @@ if (-not $?) exit 1 } +# Ignore NU1503 on vcxproj files +dotnet restore $solution /nowarn:NU1503 +if ($lastExitCode -ne 0) +{ + $result = $lastExitCode + Write-Error "Error running dotnet restore, with the exit code $lastExitCode. Please verify logs on the nuget package versions." + exit $result +} + exit 0 diff --git a/Directory.Packages.props b/Directory.Packages.props index 808d2d5ebc..a5270e7d75 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -65,7 +65,8 @@ - + + diff --git a/NOTICE.md b/NOTICE.md index 058f0863b1..bedc11379d 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1522,6 +1522,7 @@ SOFTWARE. - ModernWpfUI - Moq - MSTest +- NLog - NLog.Extensions.Logging - NLog.Schema - OpenAI diff --git a/src/modules/launcher/Wox.Plugin/Wox.Plugin.csproj b/src/modules/launcher/Wox.Plugin/Wox.Plugin.csproj index e9179e6ddf..67f7ead02c 100644 --- a/src/modules/launcher/Wox.Plugin/Wox.Plugin.csproj +++ b/src/modules/launcher/Wox.Plugin/Wox.Plugin.csproj @@ -30,6 +30,7 @@ +