Permalink
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (84 sloc) 3.96 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
<publisherPolicy> Element
03/30/2017
.net-framework
dotnet-clr
article
VB
CSharp
C++
jsharp
publisherPolicy element
container tags, <publisherPolicy> element
<publisherPolicy> element
4613407e-d0a8-4ef2-9f81-a6acb9fdc7d4
18
rpetrusha
ronpet
wpickett

<publisherPolicy> Element

Specifies whether the runtime applies publisher policy.

<configuration>
<runtime>
<assemblyBinding>
<dependentAssembly>
<publisherPolicy>

Syntax

<publisherPolicy apply="yes|no"/>  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

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

None.

Parent Elements

Element Description
configuration 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

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. 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.

Permission is required for an application to explicitly ignore publisher policy using the <publisherPolicy apply="no"/> element in the application configuration file. The permission is granted by setting the xref:System.Security.Permissions.SecurityPermissionFlag flag on the xref:System.Security.Permissions.SecurityPermission. For more information, see Assembly Binding Redirection Security Permission.

Example

The following example turns off publisher policy for the assembly, myAssembly.

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

See Also

Runtime Settings Schema
Configuration File Schema
How the Runtime Locates Assemblies
Redirecting Assembly Versions