G
Guest
I have a Class3 that looks like this:
Class1 : BaseClass
Class2 : Class1
Class3 : Class2
where each of these classes are defined in their own projects/assemblies.
They are all built in the same solution with project references. I also have
a peice of code that looks this this:
System.Reflection.Assembly assembly =
System.Reflection.Assembly.LoadFrom("Class3.dll");
Type assemblyType = assembly.GetType("Class3");
object class3 = Activator.CreateInstance(assemblyType);
if (class3 is Class3)
XXXX;
if (class3 is Class2)
YYYYY;
This code has worked for years and just broke after converting all of our
projects from using assembly references to using project references. The
first if statement fails and the XXXX code is not called. However, the
second if statement passes and the YYYY code is called. Why is this?
Looking in the debugger, the class3 object is a type Class3 , which is a
Class2, etc. Any hints on what I can look at to find this problem? Thanks?
Class1 : BaseClass
Class2 : Class1
Class3 : Class2
where each of these classes are defined in their own projects/assemblies.
They are all built in the same solution with project references. I also have
a peice of code that looks this this:
System.Reflection.Assembly assembly =
System.Reflection.Assembly.LoadFrom("Class3.dll");
Type assemblyType = assembly.GetType("Class3");
object class3 = Activator.CreateInstance(assemblyType);
if (class3 is Class3)
XXXX;
if (class3 is Class2)
YYYYY;
This code has worked for years and just broke after converting all of our
projects from using assembly references to using project references. The
first if statement fails and the XXXX code is not called. However, the
second if statement passes and the YYYY code is called. Why is this?
Looking in the debugger, the class3 object is a type Class3 , which is a
Class2, etc. Any hints on what I can look at to find this problem? Thanks?