What is AppDomain?

.net, appdomain, c#

Solution

An `AppDomain` provides a layer of isolation within a process. Everything you usually think of as "per program" (static variables etc) is actually per-AppDomain. This is useful for:

- plugins (you can unload an `AppDomain`, but not an assembly within an `AppDomain`)

- security (you can run a set of code with specific trust levels)

- isolation (you can run different versions of assemblies etc)

The pain is you need to use remoting etc.

See MSDN for lots more info. To be honest, it isn't something you need to mess with very often.

Problem

What is an AppDomain? What are the benefits of AppDomains or why Microsoft brought the concept of AppDomains, what was the problem without AppDomains? Please elaborate.

Original source

Related problems