From 7572ef5fffb4e61aae7a96736541f0777f2f40dc Mon Sep 17 00:00:00 2001 From: Emma L Garland Date: Thu, 25 Sep 2025 14:31:36 +0100 Subject: [PATCH] NuGet vulnerability warnings: Warn in non-Release mode, Error in non-Release mode (#17244) * Initial adjustment of the projects with package vulnerabilities that errored, to change to ignore the four specific Nuget vulnerability warnings in Debug mode (but not Release) as per https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904 (NU1901,NU1902,NU1903,NU1904) * Fixed formatting errors with tests * No trailing whitespace * Move NuGet vulnerability warnings error suppression to Directory.Build.props, combine WarningsNotAsErrors and fix minor issues * Update Umbraco.JsonSchema.csproj Removed unwanted change * Update Umbraco.JsonSchema.csproj Removed unwanted change * Revert unecessary changes since merge * Tweak more unecessary changes * Small tweaks * Remove space * Reverted spacing changes * Remove no longer required warning exclusions * Reverted unwanted change * Reversed order * A few tweaks to reduce warnings in Umbraco.TestData * More warnings removed as no longer an issue --------- Co-authored-by: Ronald Barendse Co-authored-by: Emma Garland Co-authored-by: Jason Elkin --- .../Umbraco.Cms.Api.Delivery.csproj | 4 +-- .../Umbraco.Cms.Persistence.SqlServer.csproj | 2 +- .../Umbraco.Cms.Persistence.Sqlite.csproj | 3 +- .../Umbraco.Cms.Targets.csproj | 1 - src/Umbraco.Core/Umbraco.Core.csproj | 2 +- .../Umbraco.Examine.Lucene.csproj | 3 +- .../Umbraco.Web.Common.csproj | 1 - .../Umbraco.Web.Website.csproj | 6 ++-- tests/Umbraco.TestData/LoadTestController.cs | 32 +++++++++---------- .../Umbraco.TestData/Umbraco.TestData.csproj | 4 +-- .../Umbraco.Tests.Benchmarks.csproj | 6 ++-- .../Builders/Extensions/BuilderExtensions.cs | 6 +++- .../Builders/MediaTypeEditingBuilder.cs | 4 ++- .../Umbraco.Tests.Common.csproj | 2 +- 14 files changed, 36 insertions(+), 40 deletions(-) diff --git a/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj b/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj index b275c6ad14..ee7db5f384 100644 --- a/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj +++ b/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj @@ -1,9 +1,8 @@ - + Umbraco CMS - Delivery API Contains the presentation layer for the Umbraco CMS Delivery API. - $(WarningsNotAsErrors),ASP0019,CS0618,CS0612 - diff --git a/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj b/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj index aeaedc4098..65ec7d93d0 100644 --- a/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj +++ b/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj @@ -7,7 +7,7 @@ $(WarningsNotAsErrors),CS0114 - diff --git a/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj b/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj index edda7db873..66e6595ed3 100644 --- a/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj +++ b/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj @@ -5,7 +5,6 @@ false false - - diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index 0274d838f8..f811139ad7 100644 --- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj +++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj @@ -5,7 +5,6 @@ Contains the web assembly needed to run Umbraco CMS. Umbraco.Cms.Web.Common - $(WarningsNotAsErrors),ASP0019,CS0618,SA1401,SA1649,IDE1006 - + diff --git a/tests/Umbraco.TestData/LoadTestController.cs b/tests/Umbraco.TestData/LoadTestController.cs index 121af67f5d..897c5ff117 100644 --- a/tests/Umbraco.TestData/LoadTestController.cs +++ b/tests/Umbraco.TestData/LoadTestController.cs @@ -27,12 +27,12 @@ public class LoadTestController : Controller private const string FootHtml = @" "; - private static readonly Random s_random = new(); - private static readonly Lock s_locko = new(); + private static readonly Random _random = new(); + private static readonly Lock _locko = new(); - private static volatile int s_containerId = -1; + private static volatile int _containerId = -1; - private static readonly string s_headHtml = @" + private static readonly string _headHtml = @" LoadTest