Permalink
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (33 sloc) 1.98 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: Configure an Application Domain
03/30/2017
.net-framework
dotnet-bcl
article
application domains, configuring
ApplicationBase property
07ea8438-7a34-49f0-a7e8-3d6ff7e4a482
9
rpetrusha
ronpet
wpickett

How to: Configure an Application Domain

You can provide the common language runtime with configuration information for a new application domain using the xref:System.AppDomainSetup class. When creating your own application domains, the most important property is xref:System.AppDomainSetup.ApplicationBase%2A. The other AppDomainSetup properties are used mainly by runtime hosts to configure a particular application domain.

The ApplicationBase property defines the root directory of the application. When the runtime needs to satisfy a type request, it probes for the assembly containing the type in the directory specified by the ApplicationBase property.

[!NOTE] A new application domain inherits only the ApplicationBase property of the creator.

The following example creates an instance of the AppDomainSetup class, uses this class to create a new application domain, writes the information to console, and then unloads the application domain.

Example

[!code-cppADApplicationBase#2] [!code-csharpADApplicationBase#2] [!code-vbADApplicationBase#2]

See Also

Programming with Application Domains
Using Application Domains