473,703 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reasoning for creating an appdomain

Hello All,

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


Dec 30 '05 #1
3 2289
Kalpesh <sh*********@gm ail.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.co m>
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?


Dec 30 '05 #3
Kalpesh <sh*********@gm ail.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
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.co m>
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Daylor | last post by:
hi. by creating new AppDomain, is that mean, the net framework creating implicitly new thread for that new AppDomain ? second q. thread can only run in one and the same one appdomain ?
by: David Elliott | last post by:
I have a 3rd Party DLL that is a Win32 NOT .NET Assembly that is misbehaving. I am trying to isolate it in its own AppDomain. I got to load but can not create an instance. I receive the following error: "The type MyNameSpace.MyClass in Assembly MyAssembly, Version=1.0.1797.22641, Culture=neutral, PublicKeyToken=null is not marked as serializable." I changed the names to protect the innocent... :)
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle." exception. The problem is that this exception isn't raised somewhere in a method, so it just shows up, and it causes the application to shut down. Is there anyway how to catch this kinds of exceptions? Can I put somewhere a
by: vareck.walla | last post by:
I get this error everytime I run my project: System.InvalidOperationException was unhandled Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Item has already been added. Key in dictionary: 'System.Runtime.CompilerServices.CompilerGeneratedAttribute' Key being added: 'System.Runtime.CompilerServices.CompilerGeneratedAttribute'" Source="Interbase® Project 2006" StackTrace:
by: ITALstudio s.r.l. | last post by:
Hy, In my application I create instances of windows forms into different AppDomain. If I repeat 5 times the following sequence: - Creating AppDomain; - Creating instance of windows form into AppDomain;
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass something else that strings between the domains...
by: John B | last post by:
What is the reasoning for recommending that all events have the signature EventHandler(object sender, EventArgs e). Obviously I can create a custom delegate delegate void FooHandler(string foo) and event FooHandler FooHappened What are the benefits of creating derived eventargs classes for each event instead of creating the delegate which is much easier IMO. Am I missing something?
by: archana | last post by:
Hi all, I am having one web application in which i want to create new appdomain for loading dll dynamically. So my question is how will i do this? I read that aspnet_wp.exe has one appdomain which is processing all request. So if i create new appdomain in webapplication how it gets manage?
by: Bill Woodruff | last post by:
Visual Studio 2005, .NET FrameWork 2.0, C#, WinForms Application Hi, I've read the recent posts by and to 'Thunderbird' (and learned a lot, thanks, from the usual masters Skeet and Paladino, and others) which involve AppDomains in a remoting scenario, but I think the issue I am working with .... while related ... is sufficiently different to warrant a new thread. I'm also working on a plug-in architecture it's for a WinForms based
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.