Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a .NET application domain?

Tags:

.net

appdomain

In particular, what are the implications of running code in two different application domains?

How is data normally passed across the application domain boundary? Is it the same as passing data across the process boundary? I'm curious to know more about this abstraction and what it is useful for.

EDIT: Good existing coverage of the AppDomain class in general at I don't understand Application Domains

like image 457
Luke Avatar asked Jul 07 '09 19:07

Luke


People also ask

What is application domain and execution domain?

Application Domain : The designer describes the ideas concerning the behaviour of software in terms related to application domain of the software. Execution Domain : To implement these ideas, their desciption has to be interpreted in terms related to the execution domain of the computer system.

What is IIS app domain?

An AppDomain is a . NET term. (In IIS7, AppDomains play a larger role within IIS, but for the most part it's an ASP.NET term) An AppDomain contains InProc session state (the default session state mode). So if an AppDomain is killed/recycled, all of your session state information will be lost.

How many application domains are there?

Process A runs managed code with one application domain while Process B runs managed code has three application domains. Note that Process C which runs unmanaged code has no application domain. Code and data are safely isolated using the boundary provided by the AppDomain.

What is a domain specific application?

Domain specific tools are a type of application software that are specific in nature. They serve some specific purpose to the user. This means that application software is of two types that are generic or specific.


1 Answers

An AppDomain basically provides an isolated region in which code runs inside of a process.

An easy way to think of it is almost like a lighter-weight process sitting inside of your main process. Each AppDomain exists within a process in complete isolation, which allows you to run code safely (it can be unloaded without tearing down the whole process if needed), with separate security, etc.

As to your specifics - if you run code in 2 different AppDomains within a process, the code will run in isolation. Any communication between the AppDomains will get either serialized or handled via MarshallByRefObject. It behaves very much like using remoting in this regard. This provides a huge amount of security - you can run code that you don't trust, and if it does something wrong, it will not affect you.

There are many more details in MSDN's description of Application Domains.

like image 136
Reed Copsey Avatar answered Sep 17 '22 13:09

Reed Copsey