Forum Xamarin.Android

How to force the class are not removed when linking?

How to force the class are not removed when linking? I write for Android application in Visual Studio 2015 on the framework, Xamarin. Faced with such a problem: The app works fine in Debug mode, but when you put the Release mode of the application functionality is lost, ie, Several classes are deleted when linking and when they call, the application crush. Tried both the written documentation Xamarin put before the class is one of the attributes:

[Android.Runtime.Preserve]
[Android.Runtime.Preserve (AllMembers = true)]
[Android.Runtime.Preserve (Conditional = true)]

did not help. I tried also:

#pragma warning disable 0219, 0649

It did not help. I tried to use linkskip, but it did not help.

The only solution is found, it is in the linker properties indicate Linker Behavior = Do not Link (None in Visual Studio) (in Debug mode). But this is a bad solution, because suitable for debugging, but not for release. And application size has increased by more than 2.5 times!

Sign In or Register to comment.