Hi,
I have three assemblies. In Assembly1 I define an abstract
base class called MyBaseClass. In Assembly2 I derive a
class from this MyBaseClass. If I asked in the derived
class if this class is a sublass of MyBaseClass the
function IsSubclassOf returns true, so this works properly.
In the third assembly however, I don't get the right
result when I ask for the subclass. My code looks as
follows:
//using namespace of Assembly1 where the MyBaseClass is
//defined
Assembly a = Assembly.LoadFrom(FileNameOfAssembly2);
foreach(Type t in a.GetTypes())
{
//the type of my derived class appaers here properly
if(t.IsSubclassOf(typeof(MyBaseClass)))
{
//never reached
}
}
I really don't know what is going wrong. I also printed
out the guid which I get from t.BaseClass.GUID. This guid
is exactly the one from MyBaseClass, so that is perfectly
right. What is going wrong? It seems to me that the types
are never recognized properly. The same happens for
attributes. If I print out the names then I get the right
ones, but if I ask explicitely for the type and compare
the type afterwards, no function returns the proper
results.
Thomas