.NET Framework General Reference
<generatePublisherEvidence> Element

Specifies whether the runtime uses code access security (CAS) publisher policy.

<configuration> Element
  <runtime> Element
    <generatePublisherEvidence> Element
<generatePublisherEvidence  
   enabled="true|false"/>
Attributes and Elements

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

Attributes

Attribute

Description

enabled

Required attribute.

Specifies whether the runtime uses CAS publisher policy.

Enabled Attribute

Value

Description

false

Does not use CAS publisher policy.

true

Uses CAS publisher policy. This is the default.

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 runtime initialization options.

Remarks

The common language runtime (CLR) tries to verify the Authenticode signature at load time to create Publisher evidence for the assembly. However, by default, most applications do not need Publisher evidence. Standard CAS policy does not rely on the PublisherMembershipCondition. You should avoid the unnecessary startup cost associated with verifying the publisher signature unless your application executes on a computer with custom CAS policy, or is intending to satisfy demands for PublisherIdentityPermission in a partial-trust environment. (Demands for identity permissions always succeed in a full-trust environment.)

NoteNote:

We recommend that services use the <generatePublisherEvidence> element to improve startup performance. Using this element can also help avoid delays that can cause a time-out and the cancellation of the service startup.

Configuration File

This element can be used only in the application configuration file.

Example

The following example shows how to use the <generatePublisherEvidence> element to disable checking for CAS publisher policy for an application.

<configuration>
    <runtime>
        <generatePublisherEvidence enabled="false"/>
    </runtime>
</configuration>
See Also

Reference

Other Resources

Tags :


Community Content

Das Wiesel
Which .NET version?

Woefully lacking from this documentation is which exact version of .NET first supported this element.

In contrast, good old Win32 APIs are very nicely documented as far as which versions of Windows they are supported in.

ADD:
This is documented in http://support.microsoft.com/kb/936707
and is supported by the Microsoft .NET Framework 2.0 and later

Tags :

Jens KL
Much time to save

Disabling this attribute may save much time, if the code runs on a machine with no direct access to the Internet. I this case each attempt to verify the signature will last 30 seconds (until timeout). And there will be several retries. So the application may be delayed by 30, 60, 90,... seconds, if the attribute is enabled.

Another subject: The documentation states that the element can be used only in the application configuration file. This was not true in my case. The element only worked in the machine.config file. It did not have any impact in the web.config file.

Tags :

new to wpf
How to set generatePublisherEvidence through C#?
The documentation says that the element can be used only in the Application Configuration file.
In my case I want to set it through C# code. Is there any way to do that?
Tags :

Page view tracker