Reputation: 361
I have a Xamarin app here that runs in debug mode without any problems, but in release mode it crashes instantly saying that a default constructor for one of my pages is missing.
Unhandled Exception:
System.MissingMethodException: Default constructor not found for type PraxisApp.MasterPage occurred
Does anyone have any suggestions why this happens in Release mode?
Upvotes: 2
Views: 1077
Reputation: 21
Try to add 'PraxisApp.MasterPage;' to your Ignore assemblies (ProjectSettings -> Android Build -> Linker)
Upvotes: 0
Reputation: 74094
It is most likely due to the fact that it is being stripped by the Mono Linker:
Add a PreserveAttribute to the top of your Page class:
[Preserve (AllMembers = true)]
public class MasterPage
{
~~~
}
Upvotes: 6