Hi people..
Unless I lost some brain somewhere, I don't understand why I can't do this..
I have an abstract class (say class1) and a child class (childclass).
I'm loading the dll with the childclass by reflection, calling up the correct class, and trying to instanciate it using a cast to class1.
Code:
Class1 class1 = (Class1) Activator.CreateInstance(childclass)
childclass has the correct type that I need to activate.
This code, throw an error that can't convert childclass to class1. Isn't this possible??? Childclass can't be converted to his base class?? or it's because it is an abstract class??? (the one I'm trying to convert it to??)