Creating Application Domains

Every .NET application has at least one application domain, known as the default domain. Additional domains can be created, either through managed code or from within hosting code in case you’re writing a CLR host. We focus on the former scenario, where we want to use application domains to isolate certain pieces of code from other pieces. Examples of such use include loading of assemblies containing add-in code into a separate application domain. This allows the hosting process to stay in control because it can unload the whole add-in domain and all of its assemblies (for example, if the add-in functionality is misbehaving). In addition, only certain communication patterns will be allowed such that the loaded add-in ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.