hi all
Can any one explain app domain concept
mainly I want to know when the App Domain is created by CLR's worker process exe?
Thanks
Ebi
hi all
Can any one explain app domain concept
mainly I want to know when the App Domain is created by CLR's worker process exe?
Thanks
Ebi
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijaya KadiyalaPosted Jul 9, 2008, 1:55 PM
Hi
An application domain is the CLR equivalent of an operation system's process. An application domain is used to isolate applications from one another. This is the same way an operating system process works. The separation is required so that applications do not affect one another. This separation is achieved by making sure than any given unique virtual address space runs exactly one application and scopes the resources for the process or application domain using that addess space.
However, a CLR application domain is seperate from a process. It is contained within an operating system process. A single CLR operating system process can contain multiple application domains. There are some major pluses to having application domains within a single process.
Check out the below link
http://codebetter.com/blogs/raymond.lewallen/archive/2005/04/03/61190.aspx
Thanks -- Vj
http://dotnetvj.blogspot.com
Niradhip ChakrabortyPosted Jul 8, 2008, 4:24 PM
Operating systems and runtime environments typically provide some form of isolation between applications. For example, Microsoft Windows uses processes to isolate applications. This isolation is necessary to ensure that code running in one application cannot adversely affect other, unrelated applications.
Application domains provide an isolation boundary for security, reliability, and versioning, and for unloading assemblies. Application domains are typically created by runtime hosts, which are responsible for bootstrapping the common language runtime before an application is run.
The logical and physical boundary created around every .NET application by the Common Language Runtime (CLR). The CLR can allow multiple .NET applications to be run in a single process by loading them into separate application domains. The CLR isolates each application domain from all other application domains and prevents the configuration, security, or stability of a running .NET applications from affecting other applications. Objects can only be moved between application domains by the use of remoting.
For most applications, we do not need to create our own application domain, the runtime host (Worker Process) creates necessary application domains .However, and sometimes an application program might also want to work with application domains. For example, an application program could load an application component into a domain to be able to unload the domain (and the component) without having to stop the entire applications
Creating:
In the following cases generally we create an application domain
1. If we create our own runtime host application,
2. If our application needs to create or work with additional application domains that are not automatically generated by the runtime.
3. If the requirement is such that some assemblies have to be managed personally, If this is the case we create our own application domain, load the assemblies that are supposed to be managed personally into application Domain.
AppDomain Class has CreateDomain() method
//To create an app Domain Explicitly
AppDomain.CreateDomain("AppDomainName");
Console.WriteLine(app.FriendlyName);// Displays child domain name
Console.WriteLine(AppDomain.CurrentDomain.FriendlyName); // Displays Host Domain name
Unloading :
When you call a Web service by using SSL and an application domain must be unloaded If the call is in progress, the application domain does not unload, a System.CannotUnloadAppDomainException exception is thrown, and the Microsoft ASP.NET worker process may die. So when we make a call to web service using SSL we explicitly unload the application domain programmatically by AppDomain.Unload method
Note : An application domain may be unloaded for some reason that is unrelated to calling the Web service. For example, if the Web.config file is modified, the application domain may be unloaded
Please follow the links below
http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx
http://www.webopedia.com/TERM/A/application_domain.html