From fc14243c179487438717583c048fdc49845a2288 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 10 Oct 2022 15:20:58 +0200 Subject: [PATCH] [dotnet] Hardcode 'true' as the default value for GenerateSatelliteAssembliesForCore. Fixes #16193. Hardcode 'true' as the default value for GenerateSatelliteAssembliesForCore, because .NET gets it wrong when building from inside VS (Windows). When building using either VSMac or the command line (either from Windows or Mac), the `MSBuildRuntimeType` property is set to `Core`, and as a result, the default value for `GenerateSatelliteAssembliesForCore` is `true`: ```xml true ``` See: https://github.com/dotnet/sdk/blob/00100960bf06cb595daba647673cd0329be896f4/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L41 This is the correct behavior. However, when building from inside Visual Studio (for Windows), the `MSBuildRuntimeType` property is set to `Full`, and thus `GenerateSatelliteAssembliesForCore` is not set to `true`, and we end up executing al.exe to generate satellite assemblies, which is wrong (al.exe complains that 'arm64' is an invalid platform). Fix this by always defaulting `GenerateSatelliteAssembliesForCore` to `true`, independent on where we're executing. Ref: https://github.com/dotnet/sdk/issues/28419. Fixes https://github.com/xamarin/xamarin-macios/issues/16193. --- dotnet/targets/Xamarin.Shared.Sdk.props | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.props b/dotnet/targets/Xamarin.Shared.Sdk.props index d710f6276662..f33d1f37d0f1 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.props +++ b/dotnet/targets/Xamarin.Shared.Sdk.props @@ -34,6 +34,11 @@ <_RuntimeIdentifierIsRequired Condition="'$(OutputType)' == 'Exe' Or '$(IsAppExtension)' == 'true'">true + + + + + true