From 8f8a499bba2f3c6a173d87fd97f1de00fc2bb036 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Mon, 10 Jul 2023 18:06:15 +0200 Subject: [PATCH 1/2] Disable AggressiveAttributeTrimming with ILLink --- dotnet/targets/Xamarin.Shared.Sdk.targets | 31 +++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 3043880a9344..cafdcd9235c8 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -96,7 +96,10 @@ - + + + + <_PlatformAssemblyName>Microsoft.$(_PlatformName) @@ -132,7 +135,6 @@ false true - <_AggressiveAttributeTrimming Condition="'$(_AggressiveAttributeTrimming)' == ''">true false false @@ -141,6 +143,15 @@ false + + + <_OriginalAggressiveAttributeTrimming>$(_AggressiveAttributeTrimming) + <_AggressiveAttributeTrimming Condition="'$(_UseNativeAot)' == 'true'">false + <_AggressiveAttributeTrimming Condition="'$(_AggressiveAttributeTrimming)' == ''">true @@ -152,9 +163,6 @@ true - - - <_GlobalizationDataFileLocation Condition="'$(_UseNativeAot)' == 'true'">Resource <_GlobalizationDataFileLocation Condition="'$(_UseNativeAot)' != 'true'">Assembly @@ -1216,6 +1224,19 @@ <_NativeExecutableObjectFiles Include="$(NativeObject)" /> + + + <_TrimmerFeatureSettings Condition="'$(_OriginalAggressiveAttributeTrimming)' != 'false' and '%(Identity)' == 'System.AggressiveAttributeTrimming'"> + true + true + + + true + true + + + + From 706da1a51ea0232c4b646853f4b8bab5e2023879 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Tue, 11 Jul 2023 12:54:13 +0200 Subject: [PATCH 2/2] Properly include platform assembly --- dotnet/targets/Xamarin.Shared.Sdk.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index cafdcd9235c8..7e5d8c983144 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -1236,7 +1236,7 @@ - +