<appDomainManagerAssembly > 元素<appDomainManagerAssembly> Element

指定为过程中的默认应用程序域提供应用程序域管理器的程序集。Specifies the assembly that provides the application domain manager for the default application domain in the process.

<运行时 ><runtime>


   value="assembly display name" />  

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.


特性Attribute 描述Description
value 必需的特性。Required attribute. 指定进程中的默认应用程序域提供应用程序域管理器的程序集的显示的名称。Specifies the display name of the assembly that provides the application domain manager for the default application domain in the process.

子元素Child Elements


父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime 包含有关程序集绑定和垃圾回收的信息。Contains information about assembly binding and garbage collection.


若要指定应用程序域管理器的类型,您必须同时指定此元素以及 <appDomainManagerType >元素。To specify the type of the application domain manager, you must specify both this element and the <appDomainManagerType> element. 如果未指定这些元素之一,另一个被忽略。If either of these elements is not specified, the other is ignored.

加载默认应用程序域时,TypeLoadException如果指定的程序集不存在,或者如果该程序集不包含由指定的类型则会引发 <appDomainManagerType >元素; 和进程无法启动。When the default application domain is loaded, TypeLoadException is thrown if the specified assembly does not exist or if the assembly does not contain the type specified by the <appDomainManagerType> element; and the process fails to start. 如果找到的程序集,但版本信息不匹配,FileLoadException引发。If the assembly is found but the version information does not match, a FileLoadException is thrown.

指定默认应用程序域的应用程序域管理器类型,请从默认应用程序域创建其他应用程序域将继承的应用程序域管理器类型。When you specify the application domain manager type for the default application domain, other application domains created from the default application domain inherit the application domain manager type. 使用AppDomainSetup.AppDomainManagerTypeAppDomainSetup.AppDomainManagerAssembly属性以指定新的应用程序域是不同的应用程序域管理器类型。Use the AppDomainSetup.AppDomainManagerType and AppDomainSetup.AppDomainManagerAssembly properties to specify a different application domain manager type for a new application domain.

指定应用程序域管理器类型要求具有完全信任的应用程序。Specifying the application domain manager type requires the application to have full trust. (例如,在桌面上运行的应用程序具有完全信任。)如果应用程序不具有完全信任,TypeLoadException引发。(For example, an application running on the desktop has full trust.) If the application does not have full trust, a TypeLoadException is thrown.

有关程序集显示名称的格式,请参阅Assembly.FullName属性。For the format of the assembly display name, see the Assembly.FullName property.

此配置元素是仅适用于.NET Framework 4 及更高版本。This configuration element is available only in the .NET Framework 4 and later.


下面的示例演示如何指定进程的默认应用程序域的应用程序域管理器是MyMgr中键入AdMgrExample程序集。The following example shows how to specify that the application domain manager for the default application domain of a process is the MyMgr type in the AdMgrExample assembly.

      <appDomainManagerType value="MyMgr" />  
         value="AdMgrExample, Version=, Culture=neutral, PublicKeyToken=6856bccf150f00b3" />  

请参阅See also