xamarin-macios
xamarin-macios copied to clipboard
Obsolete PreserveAttribute
The attribute is not needed in .NET6 and can interfere with official .NET linker attributes. The linker is able to recognize and mark reflection patterns automatically and for custom scenarios better attribute is supported https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicdependencyattribute. The assembly-level attribute handling is not needed either as that's the default .net6 behavior.
We'll need to update the generator to not generate the Preserve attribute first: https://github.com/xamarin/xamarin-macios/issues/19524