If ABC is only in a dynamically loaded class then how are you casting to
The main exe uses a base class, say Base.
Dll1 (no references for this in the main exe build) extends Base to Derived.
Dll2 and Dll3 create \ use Derived and both support an interface known by
the main exe.
The main exe loads up the dlls at run time and, through the interface, calls
Base GiveMeADoodah() in Dll1.
It then calls UseMyDoodah(Base o) in Dll2.
The first thing in Dll2 is :
public UseMyDoodah(Base o)
{
Derived d = (Derived) o;
...
}
And I would guess that line is where his problem his. The solution for us
was to ensure all dlls existed only in one place. When we had this issue
Dll2 and Dll3 were in 2 different sub-dirs (which was fine), but Dll1 had
somehow been deployed into both sub-directories (not fine.) It seemed as
though creation of the object involved using the dll from one sub-directory,
usage of the object involved the dll in a different sub-directory. Even
though it was the same dll you couldn't use an object created by one in the
other. (It helps if you cross your eyes and stand on your head when reading
this.)
Adam.