Here what I am trying to do:
BaseClass base = (BaseClass)
AppDomain.CurrentDomain.CreateInstance("DerivedClassDLL","DerivedClass");
However, there is a property I need to reach from DerivedClass to display, etc. BaseClass doesn't have that property and I cannot make it happen.
So somehow I need to cast it back to DerivedClass to reach it BUT DerivedClass isn't referenced so I cannot reach it is type easily unlike BaseClass which has reference so I can use it.
How can I accomplish this?
You basically have two options in this case:
Using dynamic
Using reflection
Since you have an instance of the derived class, this bit of reflection should do it: