J
James Hancock
Here's the scenario.
Right now I'm using a single app domain and loading my plugins into it. This
works ok, but it makes me uneasy and it also means that anyone building
plugins have to use the exact same version of my dependancies (DevExpress)
that all of the plugin stuff is built on.
What I would like to do is use an AppDomain to alieviate this issue and
allow the new appdomain to load in separate versions of these dlls as needed
for the plugin.
The problem is, that when I use any of the samples online and start doing
stuff with secondary app domains I need up with all kinds of errors.
Basically the system is based on Interfaces, so the plugin will impliment a
class with the interface on it.
I want to be able to call from my primary app domain, a function in my
plugin manager that will return the class with the interface as the
interface type so that I can make calls to functions on it as per the
interface.
I.e. I need to be able to make a call that will load up a new WinForm and
then go and do something with the new winform.
Every time I do this with Activator.CreateInstance() in the secondary
domain, I get an error in the primary domain that it can't find the
assembly. Once I even got to say that I needed to make the class
serializable on the plugin. So I did that, and then it gave me a
serialization error the next time.
I know that what you're supposed to do is make calls against the "stub"
class that is in the secondary domain, but I don't think that that is really
feesible, because I'd have to have functions for each function that is
defined in each of my interfaces would I not??
Any advice would be greatly appreciated!
Thanks,
James Hancock
Right now I'm using a single app domain and loading my plugins into it. This
works ok, but it makes me uneasy and it also means that anyone building
plugins have to use the exact same version of my dependancies (DevExpress)
that all of the plugin stuff is built on.
What I would like to do is use an AppDomain to alieviate this issue and
allow the new appdomain to load in separate versions of these dlls as needed
for the plugin.
The problem is, that when I use any of the samples online and start doing
stuff with secondary app domains I need up with all kinds of errors.
Basically the system is based on Interfaces, so the plugin will impliment a
class with the interface on it.
I want to be able to call from my primary app domain, a function in my
plugin manager that will return the class with the interface as the
interface type so that I can make calls to functions on it as per the
interface.
I.e. I need to be able to make a call that will load up a new WinForm and
then go and do something with the new winform.
Every time I do this with Activator.CreateInstance() in the secondary
domain, I get an error in the primary domain that it can't find the
assembly. Once I even got to say that I needed to make the class
serializable on the plugin. So I did that, and then it gave me a
serialization error the next time.
I know that what you're supposed to do is make calls against the "stub"
class that is in the secondary domain, but I don't think that that is really
feesible, because I'd have to have functions for each function that is
defined in each of my interfaces would I not??
Any advice would be greatly appreciated!
Thanks,
James Hancock