How to force the class are they not deleted during the binding?


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 (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!

I had the same problem and what resolved for me was to change the Linker Behavior to Link SDK assemblies only and also changing the Xamarin studio channel to Alpha.