471,326 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 software developers and data experts.

Reasoning for creating an appdomain

Hello All,

What is the scenario in which creating & unloading appdomain (other
than the default appdomain) is required ?

Kalpesh

Dec 30 '05 #1
3 2202
Kalpesh <sh*********@gmail.com> wrote:
What is the scenario in which creating & unloading appdomain (other
than the default appdomain) is required ?


Unit testing is a good example. You want to be able to load all the
relevant assemblies into a new AppDomain, and then unload it when
you've run the tests so that you can recompile the assemblies under
test and run the tests again without restarting the unit test UI.

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

How about winforms/asp.net app ?
What are the cases, where it will be better to create an appdomain &
load assemblies etc?

Kalpesh

Dec 30 '05 #3
Kalpesh <sh*********@gmail.com> wrote:
How about winforms/asp.net app ?
It entirely depends on what they're doing. I wouldn't expect an ASP.NET
app to needs to create AppDomains separately themselves (each ASP.NET
app is within its own AppDomain itself, I believe) but a WinForms app
might.
What are the cases, where it will be better to create an appdomain &
load assemblies etc?


If you need to keep a process running but start an awful lot of it
again from scratch, you might well want to use a "start-up" AppDomain
which loads the other one, and which can receive instructions to
restart (unload the current AppDomain and create a new one).

Another situation might be where you're loading plug-ins which you want
to be able to unload as well. Loading a plug-in within its own
AppDomain gives a level of separation from the "main" code which may be
valuable, and allows you to unload it later.

These are only examples, however - I'm sure other people have other use
cases. They should give you a flavour though.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 30 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Daylor | last post: by
reply views Thread by vareck.walla | last post: by
12 posts views Thread by Mats Lycken | last post: by
1 post views Thread by archana | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.