MethodAccessException with Activator.CreateInstance
Hi
I have a simple windows application project (MyProject) with one Form (MyForm) and one user control (MyControl)
I'm trying to create a new instance of MyControl by using the Activator.CreateInstance method, this failed with the inner exception:
System.MethodAccessException {MyProject.MyControl.InitializeComponent}
the help says that this exception occurs when trying to access a private or protected method, but in my case the method I'm accessing by the Activator.CreateInstance is the default constructor which is not private or protected
After many trials I found that the this exception happens ONLY if MyControl implements an interface!!
I went further and created a new UserControl (NewControl) which inherits MyControl, I added a button: btnDownload and tried to run method again, this time the exception is strange:
System.MethodAccessException {MyProject.NewControl.get_BtnDownload()}
I donnt have a 'get_btnDownload' method in my 'NewControl'!!!!!
one more thing: if I try to create an instance of NewControl in the trivial way, it works !! :
Dim C as new NewControl
the frustrating thing is that the Activator.CreateInstance have been working for more than 2 months and now its raising an exception
I'm working on Visual Studio Orcas Beta 1
Any Ideas?!
Thanks

