This is how I'm instantiating the customized type ("MyNewType" ) from Assembly B...
assem = System.Reflecti on.Assembly.Loa dFile(fn);
....
Type t = assem.GetType(c lrName);
....
MyTypeDescripto r ptd = new MyTypeDescripto r(t, vers, name, desc, longDesc);
....
typeInstance = (MyType)Activat or.CreateInstan ce(
ptd.Type, new object[] {thing, myTypeNode});
Jon
"Jon Davis" <jo*@REMOVE.ME. PLEASE.jondavis .net> wrote in message news:el******** ******@TK2MSFTN GP12.phx.gbl...
(Ignore previous [cancelled] reply...)
"Jon Skeet" <sk***@pobox.co m> wrote in message news:MP******** *************** *@news.microsof t.com...
I suspect you haven't overridden the method properly. Could you post a
short but complete example which demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean.
You already said this and gave that link in a prior thread. No I can't because I don't know how to reproduce the problem without displaying all of my code.
Here's exactly what I have, with class, instance, and object names changed for the group:
IN ASSEMBLY A:
// name changed for group
public abstract class MyType {
...
// THIS IS WHERE THE DEBUGGER GOES WHEN STEPPING THROUGH THE CODE
// name, return type name changed for group
public virtual MyResultType MyMethod( ... ) {
.. default output ..
}
}
// name changed for group
public class MyCallingType {
// name, return type name changed for group
public MyResultType[] MyActions( ... ) {
...
// type names, names changed for group
MyTypeInstanceL ist myTypeInstances = Thing.MyLoadedE xternalPlugIns;
...
for (int i=0; i<myTypeInstanc es.Count; i++) {
// type name, name changed for group
MyType myTypeInstance = myTypeInstances[i];
// NOTE THAT AT THIS POINT THE DEBUGGER
// SAYS THAT THIS IS A MyNewType (see below)
...
// type name changed for group
MyResultType pr;
...
pr = myTypeInstance. MyMethod( ... );
...
}
}
}
IN ASSEMBLY B:
// names changed for group
public class MyNewType : MyType {
...
// THIS IS WHERE THE DEBUGGER SHOULD BE GOING
// WHEN STEPPING THROUGH THE CODE
// name, return type name changed for group
public override MyResultType MyMethod( ... ) {
...
}
}
Jon