From 21de3d731d0b0391f81f8b4397b7d6e2d3fecc74 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 30 Nov 2023 09:58:15 -0600 Subject: [PATCH] [build] update $(MSBuildPackageReferenceVersion) to 17.6.3 (#221) Context: https://github.com/xamarin/xamarin-android/pull/8366 xamarin/xamarin-android#8366 is attempting to build xamarin-android against .NET 9 previews, and currently fails: (Restore target) -> tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj : error NU1605: Warning As Error: Detected package downgrade: Microsoft.Build.Framework from 17.5.0 to 17.3.2. Reference the package directly from the project to select a different version. tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj : error NU1605: MSBuildDeviceIntegration -> MSBuild.StructuredLogger 2.2.100 -> doh (>= 17.5.0) tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj : error NU1605: MSBuildDeviceIntegration -> Microsoft.Build.Framework (>= 17.3.2) tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj : error NU1605: Warning As Error: Detected package downgrade: Microsoft.Build.Utilities.Core from 17.5.0 to 17.3.2. Reference the package directly from the project to select a different version. tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj : error NU1605: MSBuildDeviceIntegration -> MSBuild.StructuredLogger 2.2.100 -> Microsoft.Build.Utilities.Core (>= 17.5.0) tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj : error NU1605: MSBuildDeviceIntegration -> Microsoft.Build.Utilities.Core (>= 17.3.2) We need to update `MSBuild.StructuredLogger` package to be able to move to .NET 9, as the `.binlog` file format changed in .NET 9. The newer `MSBuild.StructuredLogger` package, in turn, requires a newer `Microsoft.Build.Framework` package version, which is controlled here. Update the `$(MSBuildPackageReferenceVersion)` MSBuild property so that (1) it can now be overridden, which would allow version updates in the future without requiring submodule updates, and (2) update the the default value to 17.6.3. I fear that if we move to 17.8.3, we may potentially break other repos. VS 2022 17.6 is an LTS release that feels "safe", is new enough to solve the issue, and hopefully won't break anyone? Additionally, update the `System.Security.Cryptography.Xml` package so that it now uses an overridable `$(SystemSecurityCryptographyXmlVersion)` MSBuild property, which defaults to 7.0.1, in order to fix this build error: src\Microsoft.Android.Build.BaseTasks\Microsoft.Android.Build.BaseTasks.csproj : error NU1605: Detected package downgrade: System.Security.Cryptography.Xml from 7.0.1 to 6.0.1. Reference the package directly from the project to select a different version. src\Microsoft.Android.Build.BaseTasks\Microsoft.Android.Build.BaseTasks.csproj : error NU1605: Microsoft.Android.Build.BaseTasks -> Microsoft.Build.Tasks.Core 17.6.3 -> System.Security.Cryptography.Xml (>= 7.0.1) src\Microsoft.Android.Build.BaseTasks\Microsoft.Android.Build.BaseTasks.csproj : error NU1605: Microsoft.Android.Build.BaseTasks -> System.Security.Cryptography.Xml (>= 6.0.1) tests\Microsoft.Android.Build.BaseTasks-Tests\Microsoft.Android.Build.BaseTasks-Tests.csproj : error NU1605: Detected package downgrade: System.Security.Cryptography.Xml from 7.0.1 to 6.0.1. Reference the package directly from the project to select a different version. tests\Microsoft.Android.Build.BaseTasks-Tests\Microsoft.Android.Build.BaseTasks-Tests.csproj : error NU1605: Microsoft.Android.Build.BaseTasks-Tests -> Microsoft.Build.Tasks.Core 17.6.3 -> System.Security.Cryptography.Xml (>= 7.0.1) tests\Microsoft.Android.Build.BaseTasks-Tests\Microsoft.Android.Build.BaseTasks-Tests.csproj : error NU1605: Microsoft.Android.Build.BaseTasks-Tests -> System.Security.Cryptography.Xml (>= 6.0.1) --- .../MSBuildReferences.projitems | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems b/src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems index b5976b34..4c6a97c4 100644 --- a/src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems +++ b/src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems @@ -4,7 +4,8 @@ - 17.3.2 + 17.8.3 + 7.0.1 3.0.0 7.1.0-final.1.21458.1 @@ -14,7 +15,7 @@ - +