Compatibility with Xamarin
PostSharp supports Xamarin as a runtime platform only via .NET Standard. You can use PostSharp in your .NET Standard libraries and then reference these libraries in your Xamarin application project. Adding PostSharp directly to a Xamarin application project is not supported.
For a complete list of PostSharp packages that support Xamarin please refer to Requirements and Compatibility.
By default all Xamarin applications use a linker in the Release build configuration. The purpose of the linker is to discard unused code and reduce the size of the application. Linking is based on static analysis and it cannot correctly detect all the code used by PostSharp. To prevent the linker from removing the required code you need a custom linker configuration in your project.
To add a custom linker configuration to your Xamarin application project, add the following XML file to the project and set the Build Action to LinkDescription. For more detailed information about the linker configuration please refer to the Xamarin documentation: Custom Linker Configuration.
<linker> <assembly fullname="netstandard"> <type fullname="*"> </type> </assembly> </linker>