Hello Friends, In this tutorial we are going to understand the concept of AppDomain. AppDomain is a lightweight process that acts as a boundary and container for Code and data. As the operating system uses a process to isolate misbehaving code, the .NET runtime uses an AppDomain to isolate code inside of a secure boundary.

After Completing this tutorial you will understand:

  • What is AppDomain in .NET?

What is AppDomain?

Whenever we run an application basically we launch an exe that creates a process and in this process threads are created and threads are where the instruction will be executed. A Process can have multiple threads. Now the situations come when one thread performs an illegal action the whole process will terminate that’s the rule of the operating system.

In .Net we have a facility where within the process we can create logical partition and these logical Partitions are called as AppDomains. So the process will have AppDomains and inside the App Domains, we can have one or more threads. So AppDomain is a logical Partitions inside the Process containing one or more Threads. So what is the Advantage of having AppDomain? If any thread inside the AppDomain performs an illegal action only that particular Ap Domain will be terminated and other AppDomain inside the would still continue to execute. So each AppDomain inside the Process is isolated from each other that means one execution of one AppDomain does not affect the execution of other Ap Domain.
Since multiple AppDomains are part of the same process and therefore they actually share the same managed heap. This is usually not an issue since the AppDomain models prevent implicit access between Appdomains.


View More:


Hope you understand the concept of AppDomain in .Net. I would appreciate your feedback, Comments, and Suggestions.

Thank You.

1 Comment