Skip to content

Commit

Permalink
[build] update $(MSBuildPackageReferenceVersion) to 17.6.3 (#221)
Browse files Browse the repository at this point in the history
Context: dotnet/android#8366

dotnet/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)
  • Loading branch information
jonathanpeppers authored Nov 30, 2023
1 parent 08a6990 commit 21de3d7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<Project>
<!--Import this file in projects needing to reference Microsoft.Build.*.dll -->
<PropertyGroup>
<MSBuildPackageReferenceVersion>17.3.2</MSBuildPackageReferenceVersion>
<MSBuildPackageReferenceVersion Condition=" '$(MSBuildPackageReferenceVersion)' == '' ">17.8.3</MSBuildPackageReferenceVersion>
<SystemSecurityCryptographyXmlVersion Condition=" '$(SystemSecurityCryptographyXmlVersion)' == '' ">7.0.1</SystemSecurityCryptographyXmlVersion>
<LibZipSharpVersion Condition=" '$(LibZipSharpVersion)' == '' " >3.0.0</LibZipSharpVersion>
<MonoUnixVersion>7.1.0-final.1.21458.1</MonoUnixVersion>
</PropertyGroup>
Expand All @@ -14,7 +15,7 @@
<PackageReference Include="Microsoft.Build.Framework" Version="$(MSBuildPackageReferenceVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MSBuildPackageReferenceVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MSBuildPackageReferenceVersion)" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.1" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="$(SystemSecurityCryptographyXmlVersion)" />
<PackageReference Include="K4os.Compression.LZ4" Version="1.1.11" />
<PackageReference Include="Xamarin.Build.AsyncTask" Version="0.4.0" GeneratePathProperty="true" />
<PackageReference Include="Xamarin.LibZipSharp" Version="$(LibZipSharpVersion)" GeneratePathProperty="true" />
Expand Down

0 comments on commit 21de3d7

Please sign in to comment.