B
Bryan Martin
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
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