<disableFusionUpdatesFromADManager > 元素<disableFusionUpdatesFromADManager> Element

指定是否禁用允许运行时主机为应用程序域重写配置设置的默认行为。Specifies whether the default behavior, which is to allow the runtime host to override configuration settings for an application domain, is disabled.

<配置 > 元素<configuration> Element
<运行时 > 元素<runtime> Element
<disableFusionUpdatesFromADManager><disableFusionUpdatesFromADManager>

语法Syntax

<disableFusionUpdatesFromADManager enabled="0|1"/>  

特性和元素Attributes and Elements

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

特性Attributes

特性Attribute 描述Description
enabledenabled 必需的特性。Required attribute.

指定是否禁用重写合成设置的默认功能。Specifies whether the default ability to override Fusion settings is disabled.

enabled 特性enabled Attribute

Value DescriptionDescription
00 不要禁用重写合成设置的功能。Do not disable the ability to override Fusion settings. 这是默认行为,从.NET Framework 4 开始。This is the default behavior, starting with the .NET Framework 4.
11 禁用重写合成设置的功能。Disable the ability to override Fusion settings. 这将恢复为.NET Framework 的早期版本的行为。This reverts to the behavior of earlier versions of the .NET Framework.

子元素Child Elements

无。None.

父元素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.

备注Remarks

从.NET Framework 4 开始,默认行为是允许AppDomainManager要重写配置设置,通过使用对象ConfigurationFile属性或SetConfigurationBytes方法的AppDomainSetup对象传递给您的实现AppDomainManager.InitializeNewDomain的子类中的方法, AppDomainManagerStarting with the .NET Framework 4, the default behavior is to allow the AppDomainManager object to override configuration settings by using the ConfigurationFile property or the SetConfigurationBytes method of the AppDomainSetup object that is passed to your implementation of the AppDomainManager.InitializeNewDomain method, in your subclass of AppDomainManager. 对于默认应用程序域,您更改的设置重写应用程序配置文件指定的设置。For the default application domain, the settings you change override the settings that were specified by the application configuration file. 对于其他应用程序域,这些重写的配置设置,已将传递给AppDomainManager.CreateDomainAppDomain.CreateDomain方法。For other application domains, they override the configuration settings that were passed to the AppDomainManager.CreateDomain or AppDomain.CreateDomain method.

可以传递新的配置信息,也可以传递 null (Nothing在 Visual Basic 中) 以消除中传递的配置信息。You can either pass new configuration information, or pass null (Nothing in Visual Basic) to eliminate configuration information that was passed in.

未将配置信息传递给ConfigurationFile属性和SetConfigurationBytes方法。Do not pass configuration information to both the ConfigurationFile property and the SetConfigurationBytes method. 如果将配置信息传递给时,信息传递给ConfigurationFile属性被忽略,因为SetConfigurationBytes方法重写应用程序配置文件中的配置信息。If you pass configuration information to both, the information you pass to the ConfigurationFile property is ignored, because the SetConfigurationBytes method overrides configuration information from the application configuration file. 如果您使用ConfigurationFile属性,您可以将传递 null (Nothing在 Visual Basic 中) 到SetConfigurationBytes方法来消除对的调用中指定的任何配置字节AppDomainManager.CreateDomainAppDomain.CreateDomain方法。If you use the ConfigurationFile property, you can pass null (Nothing in Visual Basic) to the SetConfigurationBytes method to eliminate any configuration bytes that were specified in the call to the AppDomainManager.CreateDomain or AppDomain.CreateDomain method.

除了配置信息,可以更改以下设置,在AppDomainSetup传递给您的实现的对象AppDomainManager.InitializeNewDomain方法: ApplicationBaseApplicationNameCachePathDisallowApplicationBaseProbingDisallowBindingRedirectsDisallowCodeDownloadDisallowPublisherPolicyDynamicBaseLoaderOptimizationPrivateBinPathPrivateBinPathProbeShadowCopyDirectories,和ShadowCopyFilesIn addition to configuration information, you can change the following settings on the AppDomainSetup object that is passed to your implementation of the AppDomainManager.InitializeNewDomain method: ApplicationBase, ApplicationName, CachePath, DisallowApplicationBaseProbing, DisallowBindingRedirects, DisallowCodeDownload, DisallowPublisherPolicy, DynamicBase, LoaderOptimization, PrivateBinPath, PrivateBinPathProbe, ShadowCopyDirectories, and ShadowCopyFiles.

作为一种方式使用<disableFusionUpdatesFromADManager>元素中,您可以禁用默认行为通过创建注册表设置或通过设置环境变量。As an alternative to using the <disableFusionUpdatesFromADManager> element, you can disable the default behavior by creating a registry setting or by setting an environment variable. 在注册表中,创建一个名为COMPLUS_disableFusionUpdatesFromADManagerHKCU\Software\Microsoft\.NETFrameworkHKLM\Software\Microsoft\.NETFramework,并将值设置为 1。In the registry, create a DWORD value named COMPLUS_disableFusionUpdatesFromADManager under HKCU\Software\Microsoft\.NETFramework or HKLM\Software\Microsoft\.NETFramework, and set the value to 1. 在命令行设置环境变量COMPLUS_disableFusionUpdatesFromADManager为 1。At the command line, set the environment variable COMPLUS_disableFusionUpdatesFromADManager to 1.

示例Example

下面的示例演示如何禁止重写通过使用合成设置<disableFusionUpdatesFromADManager>元素。The following example shows how to disable the ability to override Fusion settings by using the <disableFusionUpdatesFromADManager> element.

<configuration>  
   <runtime>  
      <disableFusionUpdatesFromADManager enabled="1" />  
   </runtime>  
</configuration>  

请参阅See also