#readwise # AppDomain Class ![rw-book-cover](https://readwise-assets.s3.amazonaws.com/static/images/article0.00998d930354.png) ## Metadata - Author: [[docs.microsoft.com]] - Full Title: AppDomain Class - URL: https://docs.microsoft.com/en-us/dotnet/api/system.appdomain ## Highlights - Application domains, which are represented by AppDomain objects, help provide isolation, unloading, and security boundaries for executing managed code. Use application domains to isolate tasks that might bring down a process. If the state of the AppDomain that's executing a task becomes unstable, the AppDomain can be unloaded without affecting the process. This is important when a process must run for long periods without restarting. You can also use application domains to isolate tasks that should not share data. If an assembly is loaded into the default application domain, it cannot be unloaded from memory while the process is running. However, if you open a second application domain to load and execute the assembly, the assembly is unloaded when that application domain is unloaded. Use this technique to minimize the working set of long-running processes that occasionally use large DLLs. - On .NET Core, the AppDomain implementation is limited by design and does not provide isolation, unloading, or security boundaries. For .NET Core, there is exactly one AppDomain. Isolation and unloading are provided through [[AssemblyLoadContext Class]]. Security boundaries should be provided by process boundaries and appropriate remoting techniques.