From ffb0d0be799abf9c7acdb52e5b1d0214df5288b2 Mon Sep 17 00:00:00 2001 From: Einar Date: Thu, 30 Apr 2026 16:14:57 +0200 Subject: [PATCH] Fix publish workflow SDK mismatch and suppress NU1701 in sample projects The publish workflow has been failing since March 2026 because: 1. It installed .NET 6.0.400 SDK while global.json requires .NET 10. Test runner packages (NUnit3TestAdapter, xunit.runner.visualstudio) were restored using .NETFramework compatibility shims instead of net10.0 targets, triggering NU1701 as an error under TreatWarningsAsErrors. 2. Both Sample project NoWarn lists were missing NU1701, causing the shim-restored packages to fail the build. Fix: update the workflow to setup-dotnet 10.0.x and add NU1701 to NoWarn in both Sample projects (the packages function correctly at runtime). --- .github/workflows/publish.yml | 2 +- Sample/NUnit/Sample.NUnit.csproj | 2 +- Sample/XUnit/Sample.XUnit.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e474fb9..80c7786 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,7 +43,7 @@ jobs: - name: Setup .Net uses: actions/setup-dotnet@v4 with: - dotnet-version: "6.0.400" + dotnet-version: "10.0.x" - name: Build run: dotnet build --configuration Release diff --git a/Sample/NUnit/Sample.NUnit.csproj b/Sample/NUnit/Sample.NUnit.csproj index 8f3a027..6f9b8b5 100644 --- a/Sample/NUnit/Sample.NUnit.csproj +++ b/Sample/NUnit/Sample.NUnit.csproj @@ -5,7 +5,7 @@ true net10.0 disable - $(NoWarn);CA1707;CS1591;RCS1213;IDE0051;IDE1006;CA1051;SA1633;RCS1090;SA1649;SA1600;SA1310;SA1502;SA1134;MA0048;CA1002;MA0016;CA1515 + $(NoWarn);CA1707;CS1591;RCS1213;IDE0051;IDE1006;CA1051;SA1633;RCS1090;SA1649;SA1600;SA1310;SA1502;SA1134;MA0048;CA1002;MA0016;CA1515;NU1701 diff --git a/Sample/XUnit/Sample.XUnit.csproj b/Sample/XUnit/Sample.XUnit.csproj index f58dc7f..985387b 100644 --- a/Sample/XUnit/Sample.XUnit.csproj +++ b/Sample/XUnit/Sample.XUnit.csproj @@ -5,7 +5,7 @@ true net10.0 disable - $(NoWarn);CA1707;CS1591;RCS1213;IDE0051;IDE1006;CA1051;SA1633;RCS1090;SA1649;SA1600;SA1310;SA1502;SA1134;MA0048;CA1002;MA0016;CA1515 + $(NoWarn);CA1707;CS1591;RCS1213;IDE0051;IDE1006;CA1051;SA1633;RCS1090;SA1649;SA1600;SA1310;SA1502;SA1134;MA0048;CA1002;MA0016;CA1515;NU1701