From ef0df649f2c6927944aed759a83bb3c9588fea19 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 10 Sep 2024 11:40:09 -0700 Subject: [PATCH 01/19] Enable NuGet Audit and fix issues Microsoft.NET.HostModel can reference the live builds of the packages it depends on. These will be deployed by the SDK. Most other audit alerts were due to tasks pulling in old dependencies that aren't even used by the task. Avoid these by cherry-picking just the assemblies needed by the tasks and provided by MSBuild / SDK. This prevents NuGet from downloading the package closure with the vulnerable packages. We don't need those packages since the tasks aren't responsible for deploying them. A better solution in the future would be a targeting pack for MSBuild and the .NET SDK - so that components that contribute to these hosts have a surface area they can target without taking on responsibility for servicing. There is once case where we have a test that references NuGet.* packages which also bring in stale dependencies that overlap with framework assemblies. Avoid these by cherry-picking the NuGet packages in the same way. --- NuGet.config | 4 +++ eng/PackageDownloadAndReference.targets | 17 +++++++++++++ eng/Version.Details.xml | 12 +++++++++ eng/Versions.props | 2 ++ .../Microsoft.NET.HostModel.csproj | 4 +-- ...ft.DotNet.CoreSetup.Packaging.Tests.csproj | 8 +++++- .../src/Microsoft.NETCore.Platforms.csproj | 7 ++++-- .../Crossgen2Tasks/Crossgen2Tasks.csproj | 14 ++++++++--- .../installer.tasks/installer.tasks.csproj | 25 +++++++++++-------- .../src/ILLink.Tasks/ILLink.Tasks.csproj | 10 +++++--- 10 files changed, 81 insertions(+), 22 deletions(-) create mode 100644 eng/PackageDownloadAndReference.targets diff --git a/NuGet.config b/NuGet.config index 3a61ca31799f50..27431ad8cbe2e9 100644 --- a/NuGet.config +++ b/NuGet.config @@ -23,6 +23,10 @@ + + + + diff --git a/eng/PackageDownloadAndReference.targets b/eng/PackageDownloadAndReference.targets new file mode 100644 index 00000000000000..6ed9376ab42a1e --- /dev/null +++ b/eng/PackageDownloadAndReference.targets @@ -0,0 +1,17 @@ + + + + + lib/$(TargetFramework) + %(Identity) + false + + + + + + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 238887c6bd0983..e48de74322e561 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -402,10 +402,22 @@ + + https://github.com/NuGet/NuGet.Client + 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 + + + https://github.com/NuGet/NuGet.Client + 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 + https://github.com/NuGet/NuGet.Client 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 + + https://github.com/NuGet/NuGet.Client + 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 + https://github.com/dotnet/node 308c7d0f1fa19bd1e7b768ad13646f5206133cdb diff --git a/eng/Versions.props b/eng/Versions.props index 44522b33fd4a59..58777ace0ab5ec 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -173,8 +173,10 @@ $(MicrosoftBuildVersion) $(MicrosoftBuildVersion) $(MicrosoftBuildVersion) + 6.2.4 6.2.4 6.2.4 + 6.2.4 7.0.412701 6.0 diff --git a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj index 55a33eb7e24232..7a463b5b1a036b 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj +++ b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj index 73a3fda2b55fd4..4a4d7e6402984f 100644 --- a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj +++ b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj @@ -7,8 +7,14 @@ - + + + + + + + diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj index 24aa038645aecc..f4982e24356076 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj @@ -41,10 +41,13 @@ - - + + + + + $(NoWarn),CA1050 - - - + + + + + + + + + + + PreserveNewest diff --git a/src/tasks/installer.tasks/installer.tasks.csproj b/src/tasks/installer.tasks/installer.tasks.csproj index fee44e8622b82e..de04d0bf96a47d 100644 --- a/src/tasks/installer.tasks/installer.tasks.csproj +++ b/src/tasks/installer.tasks/installer.tasks.csproj @@ -6,19 +6,22 @@ - - - - - - - + + + + + + + + + - - - - + + + + + diff --git a/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj b/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj index ea27178d3faabe..6332aeb7bc356c 100644 --- a/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj +++ b/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj @@ -50,12 +50,16 @@ - - - + + + + + + + + From 69e424c8b318c4196b72a67f429e186453ad3f91 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 10 Sep 2024 13:27:52 -0700 Subject: [PATCH 04/19] Add a couple missing assembly references --- .../Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj | 1 + .../src/Microsoft.NETCore.Platforms.csproj | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj index 4a4d7e6402984f..cfc3c4894f280a 100644 --- a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj +++ b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj @@ -8,6 +8,7 @@ + diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj index f4982e24356076..e874251f8c3646 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj @@ -41,6 +41,8 @@ + + From 6408e8b62e38c9fa9f1cbb8ceaf43bdd1fdb728b Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 10 Sep 2024 17:57:57 -0700 Subject: [PATCH 05/19] Refactor tasks dependencies Consolidate representation of msbuild-provided task dependencies --- eng/Versions.props | 2 +- .../AndroidAppBuilder.csproj | 3 --- .../AotCompilerTask/MonoAOTCompiler.csproj | 5 ---- .../AppleAppBuilder/AppleAppBuilder.csproj | 3 --- .../Crossgen2Tasks/Crossgen2Tasks.csproj | 5 ---- src/tasks/Directory.Build.targets | 23 +++++++++++++++++++ .../LibraryBuilder/LibraryBuilder.csproj | 3 --- ...soft.NET.Sdk.WebAssembly.Pack.Tasks.csproj | 6 +---- .../Microsoft.NET.WebAssembly.Webcil.csproj | 5 ---- .../MobileBuildTasks/MobileBuildTasks.csproj | 5 ---- .../MonoTargetsTasks/MonoTargetsTasks.csproj | 14 ----------- .../TestExclusionListTasks.csproj | 3 --- .../WasmAppBuilder/WasmAppBuilder.csproj | 21 ----------------- .../WasmBuildTasks/WasmBuildTasks.csproj | 2 -- .../WorkloadBuildTasks.csproj | 2 -- .../installer.tasks/installer.tasks.csproj | 10 -------- 16 files changed, 25 insertions(+), 87 deletions(-) create mode 100644 src/tasks/Directory.Build.targets diff --git a/eng/Versions.props b/eng/Versions.props index 58777ace0ab5ec..afb90d3a37f364 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -135,7 +135,7 @@ 9.0.0-rc.1.24410.5 8.0.0 - 8.0.0 + 8.0.4 8.0.0 8.0.0 diff --git a/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj b/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj index 298896d2384fad..00b863c5ea59a4 100644 --- a/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj +++ b/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj @@ -10,9 +10,6 @@ - - - diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj b/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj index 0afdb5563cc660..83bf896ccc9324 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj @@ -11,11 +11,6 @@ $(NoWarn),CS8604,CS8602 true - - - - - diff --git a/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj b/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj index fe87320a2da81f..a2c93c2f89d2a0 100644 --- a/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj +++ b/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj @@ -10,9 +10,6 @@ - - - diff --git a/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj b/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj index 063d7d1a589227..d62e00bd5a478a 100644 --- a/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj +++ b/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj @@ -6,17 +6,12 @@ $(NoWarn),CA1050 - - - - - PreserveNewest diff --git a/src/tasks/Directory.Build.targets b/src/tasks/Directory.Build.targets new file mode 100644 index 00000000000000..aa1ec0ebb56999 --- /dev/null +++ b/src/tasks/Directory.Build.targets @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tasks/LibraryBuilder/LibraryBuilder.csproj b/src/tasks/LibraryBuilder/LibraryBuilder.csproj index 50cd1c06867ef8..7fa908222541d9 100644 --- a/src/tasks/LibraryBuilder/LibraryBuilder.csproj +++ b/src/tasks/LibraryBuilder/LibraryBuilder.csproj @@ -10,9 +10,6 @@ - - - diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj index 3e1e01fb6b8fef..cd0c8abf3debd7 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj @@ -20,11 +20,7 @@ - - - - - + diff --git a/src/tasks/Microsoft.NET.WebAssembly.Webcil/Microsoft.NET.WebAssembly.Webcil.csproj b/src/tasks/Microsoft.NET.WebAssembly.Webcil/Microsoft.NET.WebAssembly.Webcil.csproj index 14ecec43bf1255..0d80423d1bd000 100644 --- a/src/tasks/Microsoft.NET.WebAssembly.Webcil/Microsoft.NET.WebAssembly.Webcil.csproj +++ b/src/tasks/Microsoft.NET.WebAssembly.Webcil/Microsoft.NET.WebAssembly.Webcil.csproj @@ -12,11 +12,6 @@ true - - - - - diff --git a/src/tasks/MobileBuildTasks/MobileBuildTasks.csproj b/src/tasks/MobileBuildTasks/MobileBuildTasks.csproj index 579323eb4aba23..a1fd7dbeb86962 100644 --- a/src/tasks/MobileBuildTasks/MobileBuildTasks.csproj +++ b/src/tasks/MobileBuildTasks/MobileBuildTasks.csproj @@ -13,11 +13,6 @@ - - - - - diff --git a/src/tasks/MonoTargetsTasks/MonoTargetsTasks.csproj b/src/tasks/MonoTargetsTasks/MonoTargetsTasks.csproj index 3c652477cad9e3..566b037b5099be 100644 --- a/src/tasks/MonoTargetsTasks/MonoTargetsTasks.csproj +++ b/src/tasks/MonoTargetsTasks/MonoTargetsTasks.csproj @@ -5,20 +5,6 @@ enable $(NoWarn),CA1050,CA1850 - - - - - - - - - - - - - - diff --git a/src/tasks/TestExclusionListTasks/TestExclusionListTasks.csproj b/src/tasks/TestExclusionListTasks/TestExclusionListTasks.csproj index 97871978faeb46..e5148d3df97f26 100644 --- a/src/tasks/TestExclusionListTasks/TestExclusionListTasks.csproj +++ b/src/tasks/TestExclusionListTasks/TestExclusionListTasks.csproj @@ -13,9 +13,6 @@ - - - diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index 34a689f680da40..31ec39894476be 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -24,27 +24,6 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj b/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj index 0f7f591c2b9993..b38881fbba2ec7 100644 --- a/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj +++ b/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj @@ -6,8 +6,6 @@ $(NoWarn),CA1050 - - diff --git a/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj b/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj index 50249f07c44e07..67e092c8b4fa13 100644 --- a/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj +++ b/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj @@ -9,8 +9,6 @@ - - diff --git a/src/tasks/installer.tasks/installer.tasks.csproj b/src/tasks/installer.tasks/installer.tasks.csproj index de04d0bf96a47d..031a237ecc1860 100644 --- a/src/tasks/installer.tasks/installer.tasks.csproj +++ b/src/tasks/installer.tasks/installer.tasks.csproj @@ -6,22 +6,12 @@ - - - - - - - - - - From 294f2800777ed30e7b1ba3ee0b11626102c37239 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 10 Sep 2024 20:02:28 -0700 Subject: [PATCH 06/19] Fix audit warnings in tests --- eng/Versions.props | 3 ++- .../Kerberos/System.Net.Security.Kerberos.Shared.projitems | 1 + .../Microsoft.Extensions.Logging.Generators.targets | 1 + .../tests/SerializableAssembly.csproj | 4 +--- .../IntrinsicsInSystemPrivateCoreLib.Tests.csproj | 2 ++ .../JSImportGenerator.Unit.Tests.csproj | 3 +++ .../ComInterfaceGenerator.Unit.Tests.csproj | 3 +++ .../CustomMarshallerAttributeFixerTest.cs | 2 +- .../LibraryImportGenerator.Unit.Tests.csproj | 3 +++ .../SerializationTypes/SerializationTypes.csproj | 6 ------ .../System.Text.Json.SourceGeneration.Unit.Tests.targets | 1 + .../System.Text.RegularExpressions.Tests.csproj | 3 +++ 12 files changed, 21 insertions(+), 11 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index afb90d3a37f364..a6be368227c51a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -118,6 +118,7 @@ 5.0.0 4.8.6 8.0.0 + 8.0.1 5.0.0 4.5.5 9.0.0-rc.1.24410.5 @@ -206,7 +207,7 @@ 2.46.3 2.45.0 2.45.0 - 1.1.2-beta1.23323.1 + 1.1.2 1.7.2 10.2.0 17.0.46 diff --git a/src/libraries/Common/tests/System/Net/Security/Kerberos/System.Net.Security.Kerberos.Shared.projitems b/src/libraries/Common/tests/System/Net/Security/Kerberos/System.Net.Security.Kerberos.Shared.projitems index a184e0a870b294..f5a2b38e529ffd 100644 --- a/src/libraries/Common/tests/System/Net/Security/Kerberos/System.Net.Security.Kerberos.Shared.projitems +++ b/src/libraries/Common/tests/System/Net/Security/Kerberos/System.Net.Security.Kerberos.Shared.projitems @@ -36,5 +36,6 @@ + diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets index dfc5b8e9ad7856..5d9a4892605fe5 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets @@ -19,6 +19,7 @@ + diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj b/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj index 63c73358bea00d..ab08ca5fa8ffe5 100644 --- a/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj +++ b/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj @@ -8,9 +8,7 @@ - - all - + diff --git a/src/libraries/System.Private.CoreLib/tests/IntrinsicsInSystemPrivatecoreLibAnalyzer.Tests/IntrinsicsInSystemPrivateCoreLib.Tests.csproj b/src/libraries/System.Private.CoreLib/tests/IntrinsicsInSystemPrivatecoreLibAnalyzer.Tests/IntrinsicsInSystemPrivateCoreLib.Tests.csproj index d180cd0e34b898..5ebeb006a19de6 100644 --- a/src/libraries/System.Private.CoreLib/tests/IntrinsicsInSystemPrivatecoreLibAnalyzer.Tests/IntrinsicsInSystemPrivateCoreLib.Tests.csproj +++ b/src/libraries/System.Private.CoreLib/tests/IntrinsicsInSystemPrivatecoreLibAnalyzer.Tests/IntrinsicsInSystemPrivateCoreLib.Tests.csproj @@ -15,6 +15,8 @@ + + diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj index f5fa756b2fc3e3..209a877eea85e4 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj @@ -25,6 +25,9 @@ + + + diff --git a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj index cad3ba79d0b463..bb52511cc0a7c4 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj @@ -32,6 +32,9 @@ + + + diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CustomMarshallerAttributeFixerTest.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CustomMarshallerAttributeFixerTest.cs index 2380a0b9d8b4a7..d0c3100dcd22d0 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CustomMarshallerAttributeFixerTest.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CustomMarshallerAttributeFixerTest.cs @@ -22,7 +22,7 @@ internal class CustomMarshallerAttributeFixerTest : CSharpCodeFixVerifier SortDistinctDiagnostics(IEnumerable<(Project project, Diagnostic diagnostic)> diagnostics) + protected override ImmutableArray<(Project project, Diagnostic diagnostic)> SortDistinctDiagnostics(ImmutableArray<(Project project, Diagnostic diagnostic)> diagnostics) => diagnostics.OrderBy(d => d.diagnostic.Location.GetLineSpan().Path, StringComparer.Ordinal) .ThenBy(d => d.diagnostic.Location.SourceSpan.Start) .ThenBy(d => d.diagnostic.Location.SourceSpan.End) diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj index f7ea6cfd050a42..0633626aeb4c95 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj @@ -36,6 +36,9 @@ + + + diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SerializationTypes/SerializationTypes.csproj b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SerializationTypes/SerializationTypes.csproj index 4967c15f1e066e..58cfda595c39d5 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SerializationTypes/SerializationTypes.csproj +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SerializationTypes/SerializationTypes.csproj @@ -13,12 +13,6 @@ false - - - all - - - diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets index 56bf105dc1fddf..5bc2184ba33ef5 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets @@ -7,6 +7,7 @@ + diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj index fa554e131a54fb..796fd72794b52d 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj @@ -81,6 +81,9 @@ + + + Date: Wed, 11 Sep 2024 18:25:03 -0700 Subject: [PATCH 07/19] Remove MetadataLoadContext from WasmAppBuilder package --- src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index 31ec39894476be..7e2ba240259739 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -33,8 +33,6 @@ - From 5a220467ff93134a3ac86bb1bdc85c4c9c0899a2 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 12 Sep 2024 07:14:12 -0700 Subject: [PATCH 08/19] Update Analyzer.Testing packages --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index a6be368227c51a..3d9d05d2ad5590 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -207,7 +207,7 @@ 2.46.3 2.45.0 2.45.0 - 1.1.2 + 1.1.3-beta1.24423.1 1.7.2 10.2.0 17.0.46 From fe775ec5d0716c4d13088ca767dd1269ce2a2b50 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 13 Sep 2024 11:56:35 -0700 Subject: [PATCH 09/19] Reduce exposure of Microsoft.Build.Tasks.Core --- src/tasks/Directory.Build.targets | 2 -- src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tasks/Directory.Build.targets b/src/tasks/Directory.Build.targets index aa1ec0ebb56999..8f8f49047d2302 100644 --- a/src/tasks/Directory.Build.targets +++ b/src/tasks/Directory.Build.targets @@ -5,8 +5,6 @@ - - diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index 7e2ba240259739..24cb001591f224 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -26,6 +26,9 @@ + + + From b84f0101908c60e1a55612ba0ef82e96590956e9 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 13 Sep 2024 13:27:49 -0700 Subject: [PATCH 10/19] Fix audit warnings that only occur on browser --- ...DependencyInjection.ExternalContainers.Tests.csproj | 10 +++++++--- .../Microsoft.Extensions.Logging.Generators.targets | 4 ++++ ...ystem.Text.Json.SourceGeneration.Unit.Tests.targets | 4 ++++ src/mono/wasm/symbolicator/WasmSymbolicator.csproj | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj index 07eea0b4021952..4ca8c97b32c5bc 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -28,6 +28,10 @@ + + diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets index 5d9a4892605fe5..115a93167b3892 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/Microsoft.Extensions.Logging.Generators.targets @@ -19,7 +19,11 @@ + + + + diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets index 5bc2184ba33ef5..96e0f7a5885ec7 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Unit.Tests.targets @@ -7,7 +7,11 @@ + + + + diff --git a/src/mono/wasm/symbolicator/WasmSymbolicator.csproj b/src/mono/wasm/symbolicator/WasmSymbolicator.csproj index 6d290842a3080e..cab59420a1f59d 100644 --- a/src/mono/wasm/symbolicator/WasmSymbolicator.csproj +++ b/src/mono/wasm/symbolicator/WasmSymbolicator.csproj @@ -9,6 +9,8 @@ + + From c1d3d094f489e5871ccc71c3cbd013d8b9a5ae51 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 17 Sep 2024 08:55:28 -0700 Subject: [PATCH 11/19] Update Asn1 used by linker analyzer tests --- .../ILLink.RoslynAnalyzer.Tests.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj index 3379e06af5725c..bbc48d7d344cb9 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj @@ -26,6 +26,8 @@ + + From a501794770590346f4e57ad2607bb23aea1b1a73 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 17 Sep 2024 12:55:53 -0700 Subject: [PATCH 12/19] React to breaking change in analyzer test SDK --- .../Verifiers/CSharpCodeFixVerifier`2.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpCodeFixVerifier`2.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpCodeFixVerifier`2.cs index 808fc4b772884f..96de52df41d3c9 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpCodeFixVerifier`2.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpCodeFixVerifier`2.cs @@ -43,7 +43,7 @@ public Test () }); } - protected override ImmutableArray<(Project project, Diagnostic diagnostic)> SortDistinctDiagnostics (IEnumerable<(Project project, Diagnostic diagnostic)> diagnostics) + protected override ImmutableArray<(Project project, Diagnostic diagnostic)> SortDistinctDiagnostics (ImmutableArray<(Project project, Diagnostic diagnostic)> diagnostics) { // Only include non-suppressed diagnostics in the result. Our tests suppress diagnostics // with 'UnconditionalSuppressMessageAttribute', and expect them not to be reported. From 36a7b291b3827646ffdbb0f0d24d82eab54b0e92 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 17 Sep 2024 13:03:10 -0700 Subject: [PATCH 13/19] Enable working DryIoc tests --- .../tests/DI.External.Tests/DryIoc.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/DryIoc.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/DryIoc.cs index a57b843bf72fe3..3f943cd49e16ad 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/DryIoc.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/DryIoc.cs @@ -9,12 +9,7 @@ namespace Microsoft.Extensions.DependencyInjection.Specification { public class DryIocDependencyInjectionSpecificationTests : SkippableDependencyInjectionSpecificationTests { - public override bool SupportsIServiceProviderIsService => false; - - public override string[] SkippedTests => new[] - { - "ServiceScopeFactoryIsSingleton" - }; + public override string[] SkippedTests => []; protected override IServiceProvider CreateServiceProviderImpl(IServiceCollection serviceCollection) { From da23192da2e49cb538b2ed438087111098b4095b Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Wed, 18 Sep 2024 18:11:49 -0700 Subject: [PATCH 14/19] Fix double-write when LibrariesConfiguration differs from Configuration --- src/installer/Directory.Build.targets | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/installer/Directory.Build.targets b/src/installer/Directory.Build.targets index c4e8a8c8fb7011..05fd40401d14c2 100644 --- a/src/installer/Directory.Build.targets +++ b/src/installer/Directory.Build.targets @@ -5,6 +5,18 @@ $(ArchiveName)-pgo + + + + + + + + + + + lib/$(TargetFramework) diff --git a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj index cfc3c4894f280a..1a3c7fe037c365 100644 --- a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj +++ b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj @@ -7,14 +7,11 @@ - - - - - - + + + - + diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj index e874251f8c3646..84e378bd855c6a 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj @@ -41,15 +41,16 @@ + - + - + - - + + diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj index 209a877eea85e4..9de41597b0c8c6 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj @@ -3,7 +3,7 @@ $(NetCoreAppCurrent) enable true - true + true @@ -25,9 +25,9 @@ - + - + diff --git a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj index bb52511cc0a7c4..c2d8e9ef2cb3be 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/ComInterfaceGenerator.Unit.Tests.csproj @@ -32,9 +32,9 @@ - - - + + + diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj index 0633626aeb4c95..ac398b9cce9f36 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj @@ -36,9 +36,9 @@ - - - + + + diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj index 796fd72794b52d..e84848318f7060 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj @@ -82,8 +82,8 @@ - - + + $(NoWarn),CA1050 + - + PreserveNewest diff --git a/src/tasks/Directory.Build.targets b/src/tasks/Directory.Build.targets index 8f8f49047d2302..9ac11c543dc535 100644 --- a/src/tasks/Directory.Build.targets +++ b/src/tasks/Directory.Build.targets @@ -7,15 +7,16 @@ - + - + + - \ No newline at end of file + diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index 349eab26e3ad58..b98c2bd0657b8f 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -27,7 +27,9 @@ - + + diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj index bbc48d7d344cb9..47a4fe47d0f09b 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/ILLink.RoslynAnalyzer.Tests.csproj @@ -26,8 +26,8 @@ - - + + From 3772ac908465febd3856b7e43b91ea5b91894bd3 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 23 Sep 2024 11:09:35 -0700 Subject: [PATCH 17/19] Make HostModel references private This ensures projects referenced will not be rebuilt by tests. This also means the HostModel package will not list these as references, but that's OK since the SDK provides them and this is not a shipping package. --- .../Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj index 6c09125e72a41d..c022d8b43bae62 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj +++ b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj @@ -19,9 +19,9 @@ - - - + + + From d93f35c4b9569a16e3f8d2ab2ad3aa78ecff809b Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 23 Sep 2024 16:03:22 -0700 Subject: [PATCH 18/19] Use ProjectReferenceExclusion to avoid framework project references On .NETCore we want to use the targeting pack and avoid rebuilding libs. --- Directory.Build.targets | 4 ++-- .../Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj | 6 +++--- src/installer/tests/Directory.Build.targets | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 279184d1eb0c47..1c18278a4294ef 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -143,12 +143,12 @@ + ('@(DefaultReferenceExclusion)' != '' or '@(ProjectReferenceExclusion)' != '')"> <_transitiveProjectReferenceWithProjectName Include="@(ProjectReference->Metadata('NuGetPackageId'))" OriginalIdentity="%(Identity)" /> <_transitiveIncludedProjectReferenceWithProjectName Include="@(_transitiveProjectReferenceWithProjectName)" - Exclude="@(DefaultReferenceExclusion)" /> + Exclude="@(DefaultReferenceExclusion);@(ProjectReferenceExclusion)" /> <_transitiveExcludedProjectReferenceWithProjectName Include="@(_transitiveProjectReferenceWithProjectName)" Exclude="@(_transitiveIncludedProjectReferenceWithProjectName)" /> diff --git a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj index c022d8b43bae62..6c09125e72a41d 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj +++ b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/src/installer/tests/Directory.Build.targets b/src/installer/tests/Directory.Build.targets index 9bfb4ffbea286e..1b67f398587725 100644 --- a/src/installer/tests/Directory.Build.targets +++ b/src/installer/tests/Directory.Build.targets @@ -1,5 +1,11 @@ + + + + + + - +