My load function looks something like this
Function Load(ByVal AssemblyName as string, ExpectedType as Type)as object
After loading the assembly I loop though the types finding all that equal
the expectedtype.
I have also passed a class of expected type to the function and set it to
the newly created object. This allows me to use the class to call the
methods successfully inside this domain but when it gets passed back I still
get bombed.
Thanks for your time.
Bryan
"Jon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Normally you pass a common interface or a common abstract class between
the app domains.
>
> Do you plan to pass the whole new type back, and have the parent use
reflection to access the properties?
>
> "Bryan Martin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> > I have a object that is created in a seperate domain which needs to be
> > passed back to the parent class. Because this object is created in a
> > seperate domain if I try to pass the object back to the parent class
> > (different domain) I receive an error about "File Not Found". I know
the
> > object is created successfully and the objects method can be called
after
> > loading the object however upon passing it back to the calling class it
> > exploades. I do not want to proxy everything though the loader class so
it
> > can be versitile enough to load other objects with different methods. I
> > would much rather pass the loaded object back to the parent and have it
deal
> > with what class/methods.
> >
> > The original post from Thursday, July 31, 2003
> > Scenario is to load assembly in its own domain and return objects back
to
> > the parent for later use. Plug-in style
> >
> > ParentProgram
> > Creates a new class named PluginLoader and calls sub loadassembly
> >
> > PluginLoader
> > LoadAssembly creates a new appdomain and new class PluginProcessor.
Next it
> > lets pluginprocessor load the actual objects needed from the assembly
> > because I need this to run in its own appdomain so I can unload it if
need
> > be.
> >
> > PluginProcessor
> > Loads the assembly and gathers the required objects. Right after
loading
> > object, method is called inside the object and works fine. Next I try
to
> > return this object back to PluginLoader. PluginLoader attempts to call
> > method inside object and fails with "File or assembly name LoadedObject,
or
> > one of its dependencies, was not found."
> >
> > What am I missing? How do I get the object back to the parent? I know
it
> > was found due to being able to call the methods inside PluginProcessor
> > successfully.
> >
> > Bryan
> >
> >
> >
> >
>
>
|