[mono-android] Activator.CreateInstance

Jonathan Pryor jpryor at novell.com
Thu Mar 24 21:54:12 EDT 2011


On Mar 24, 2011, at 9:47 PM, Dave Goughnour wrote:
> I’m porting code that runs fine in .NET and am having problems with Activator.CreateInstance. I tried the version that takes in a type and calls the default constructor as well as the version that takes a type and an object[] of parameters and both complain that the method is not found but they both work fine in .NET. Any known issues with this?

You're missing a [Android.Runtime.PreserveAttribute] on your constructor.

My apologies, as we need to better document this, but Mono for Android is following the design of MonoTouch here:

	http://monotouch.net/Documentation/API_Design#PreserveAttribute

 - Jon



More information about the Monodroid mailing list