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 anAppDomain
) - 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.