diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 3043880a9344..7e5d8c983144 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 + + + +