<publisherPolicy > 元素<publisherPolicy> Element

指定运行时是否使用发布者策略。Specifies whether the runtime applies publisher policy.

<运行时 ><runtime>


<publisherPolicy apply="yes|no"/>  

特性和元素Attributes and Elements

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


特性Attribute 描述Description
apply 指定是否将应用发布者策略。Specifies whether to apply publisher policy.

应用特性apply Attribute

“值”Value 描述Description
yes 将发布服务器策略应用。Applies publisher policy. 此为默认设置。This is the default setting.
no 不适用于发布服务器策略。Does not apply publisher policy.

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


时组件供应商发布新版本的程序集,供应商可以包括发布服务器策略,以便现在使用旧版本的应用程序使用新版本。When a component vendor releases a new version of an assembly, the vendor can include a publisher policy so applications that use the old version now use the new version. 若要指定是否为特定的程序集应用出版商策略,请将 <publisherPolicy > 中的元素 <dependentAssembly > 元素。To specify whether to apply publisher policy for a particular assembly, put the <publisherPolicy> element in the <dependentAssembly> element.

默认设置为应用属性是The default setting for the apply attribute is yes. 设置应用归于没有替代以前所有程序集的设置。Setting the apply attribute to no overrides any previous yes settings for an assembly.

权限是以显式忽略发行者策略使用的应用需要 <apply ="no"/ >应用程序配置文件中的元素。Permission is required for an application to explicitly ignore publisher policy using the <publisherPolicy apply="no"/> element in the application configuration file. 通过设置授予权限SecurityPermissionFlag标志SecurityPermissionThe permission is granted by setting the SecurityPermissionFlag flag on the SecurityPermission. 有关详细信息,请参阅程序集绑定重定向安全权限For more information, see Assembly Binding Redirection Security Permission.


下面的示例会关闭发行者策略程序集, myAssemblyThe following example turns off publisher policy for the assembly, myAssembly.

      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
            <assemblyIdentity name="myAssembly"  
                                    culture="neutral" />  
            <publisherPolicy apply="no"/>  

请参阅See also