Application Domains

The Windows operating system uses processes to isolate different applications.
This isolation is necessary to ensure that code running in one application doesn't interfere with code running in another application.
Application domains are created to provide this isolation.
An application domain is usually created by runtime host.
You must load an assembly into an application domain for the code to run.
A single application often has several assemblies all loaded into one single application domain.

An application domain gives the .NET Framework a way of isolating applications that are running in the same process.
For example when you are running multiple add-ins in the same application.
If one of them needs to be reloaded you don't want the other add-ins to be affected.
Loading the add-ins into separate application domains guarantees this isolation.

You can also set security permissions on an application domain.
For example when an application domain is created for a VSTO solution, the runtime sets a policy for the application domain so that it does not trust the My Computer Zone
This practice ensures that the code in the My Computer Zone has been granted trust explicitly rather than allowing all code to run by default.


For more information Threading > Processes
An App Domain can contain one or more threads.
Threads can cross between different App Domains.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext