Permalink
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (30 sloc) 1.7 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
How to: Create an Application Domain
03/30/2017
.net-framework
dotnet-bcl
article
application domains, creating
ba1fa43e-49f5-47d9-bd7f-3024af16f4ba
9
rpetrusha
ronpet
wpickett

How to: Create an Application Domain

A common language runtime host creates application domains automatically when they are needed. However, you can create your own application domains and load into them those assemblies that you want to manage personally. You can also create application domains from which you execute code.

You create a new application domain using one of the overloaded CreateDomain methods in the xref:System.AppDomain?displayProperty=nameWithType class. You can give the application domain a name and reference it by that name.

The following example creates a new application domain, assigns it the name MyDomain, and then prints the name of the host domain and the newly created child application domain to the console.

Example

[!code-cppADCreateDomain#2] [!code-csharpADCreateDomain#2] [!code-vbADCreateDomain#2]

See Also

Programming with Application Domains
Using Application Domains