By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,784 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,784 IT Pros & Developers. It's quick & easy.

AppDomains and Dynamic un/re-loading

P: n/a
I'm currently developing a client that connects to a server and exchanges
data with the server back and forth. The client retains the data in specified
classes depending on what was received. While adding a plugin type API I ran
into the following problem:

I want users to be able to dynamically un/re-load their plugins as needed,
but without having to restart the client. Searching quickly pointed me to
articles on AppDomains. However none of them seem to explain how I can allow
these plugins to access data that in being retained by the client in its
classes.

So basicly:

I have a client with info.
I have plugins that need to access this from the plugin while maintaining
the ability to dynamically un/re-load the plugin.

Any ideas or articles that could explain how to go about this?
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ASayre <AS****@discussions.microsoft.com> wrote:
I'm currently developing a client that connects to a server and exchanges
data with the server back and forth. The client retains the data in specified
classes depending on what was received. While adding a plugin type API I ran
into the following problem:

I want users to be able to dynamically un/re-load their plugins as needed,
but without having to restart the client. Searching quickly pointed me to
articles on AppDomains. However none of them seem to explain how I can allow
these plugins to access data that in being retained by the client in its
classes.

So basicly:

I have a client with info.
I have plugins that need to access this from the plugin while maintaining
the ability to dynamically un/re-load the plugin.

Any ideas or articles that could explain how to go about this?


Welcome to the wonderful world of marshalling :)

This is a tricky topic, with various options. If you're able to make
everything you the plugins need derive from MarshalByRefObject at some
point, it's probably not *too* bad - otherwise you'll need to be very
careful in exactly how things are marshalled when. Alternatively, you
might want to try to load as much as possible into the temporary
AppDomain, leaving your "main" AppDomain as a pretty empty shell which
just does enough to get the other AppDomains up and running, and handle
unloading and reloading.

I don't have any articles to hand on how best to do this, but you
should probably have a look at the NUnit source code
(http://www.nunit.org) as that does exactly the same kind of thing as
it sounds like you need to.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.