Skip to content

Commit e2d0ae2

Browse files
[xabt] Xamarin.Android.Build.Tasks.dll should be strong-named (#10377)
Fixes: dotnet/maui#30948 MSBuild task assemblies can run on .NET framework when building inside Visual Studio. If you have a .NET 8, .NET 9, and .NET 10 project in the same solution, the best way to support this is to strong name *and* version your assembly so that .NET framework can load multiple copies of it. This can also happen if you update the `$(TargetFramework)` while a project is open. Unfortunately, #30948 uncovered an issue when .NET 9 and .NET 10: * .NET 8 `Xamarin.Android.Build.Tasks.dll`: strong named * .NET 9 `Xamarin.Android.Build.Tasks.dll`: *not* strong named * .NET 10 `Xamarin.Android.Build.Tasks.dll`: *not* strong named I suspect this went wrong in 003f5d1, but we didn't notice it until now because .NET 8 was strong-named and .NET 9 was not. To fix this, we simply need to set `$(SignAssembly)` to `true`. Prior to 003f5d1, this was set to false because the ILRepack process signed at the end of the repacking. When ILRepack was removed, we forgot to enable strong name signing! Whoops!
1 parent e044f97 commit e2d0ae2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<DefineConstants>$(DefineConstants);TRACE;HAVE_CECIL;MSBUILD;XABT_MANIFEST_EXTENSIONS</DefineConstants>
1818
<AndroidGeneratedClassDirectory Condition=" '$(AndroidGeneratedClassDirectory)' == '' ">..\..\src\Mono.Android\obj\$(Configuration)\$(DotNetTargetFramework)\android-$(AndroidLatestStablePlatformId)\mcw</AndroidGeneratedClassDirectory>
1919
<NoWarn>8632</NoWarn>
20-
<SignAssembly>false</SignAssembly>
20+
<SignAssembly>true</SignAssembly>
2121
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
2222
<Nullable>enable</Nullable>
2323
<!-- Causes issues with linker files imported from Mono -->

0 commit comments

Comments
 (0)