Application Domains

Application domains give the .NET Framework a way to isolate applications that are running in the same process. For example, if you're running multiple add-ins for your application and if one of them needs to be reloaded, you would want to ensure that the other add-ins are not affected. Loading the add-ins into a separate application domain guarantees this isolation. You can run several application domains in a single process and achieve the same level of isolation that exists when you run the applications in separate processes.

You can also set security permissions on an application domain. For example, when an application domain is created for a VSTO solution, the VSTO runtime sets 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. You'll learn more about security in Chapter 11, Security and Deployment.

0 0

Post a comment