Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Example messages
error XA1049: The 'AndroidEnableMarshalMethods' and 'PublishReadyToRun' MSBuild properties cannot both be set to 'true'. Set one property to 'false'.
Issue
$(AndroidEnableMarshalMethods)
rewrites managed assemblies after trimming, while
$(PublishReadyToRun)
adds native code to those assemblies. The marshal methods rewriter cannot modify
ReadyToRun assemblies.
Solution
Disable marshal methods or ReadyToRun in the project file:
<PropertyGroup>
<AndroidEnableMarshalMethods>false</AndroidEnableMarshalMethods>
</PropertyGroup>
Alternatively:
<PropertyGroup>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>