<generatePublisherEvidence > 元素<generatePublisherEvidence> Element

指定是否在运行时创建Publisher代码访问安全性 (CAS) 的证据。Specifies whether the runtime creates Publisher evidence for code access security (CAS).

<configuration><configuration>
<运行时 ><runtime>
<generatePublisherEvidence><generatePublisherEvidence>

语法Syntax

<generatePublisherEvidence    
   enabled="true|false"/>  

特性和元素Attributes and Elements

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

特性Attributes

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

指定是否在运行时创建Publisher证据。Specifies whether the runtime creates Publisher evidence.

enabled 特性enabled Attribute

Value 描述Description
false 不会创建Publisher证据。Does not create Publisher evidence.
true 创建Publisher证据。Creates Publisher evidence. 这是默认设置。This is the default.

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

备注Remarks

备注

在.NET Framework 4 及更高版本,此元素将具有对程序集加载时间没有影响。In the .NET Framework 4 and later, this element has no effect on assembly load times. 有关详细信息,请参阅中的"安全策略简化"一节安全更改For more information, see the "Security Policy Simplification" section in Security Changes.

公共语言运行时 (CLR) 尝试在加载时,若要创建验证 Authenticode 签名Publisher程序集证据。The common language runtime (CLR) tries to verify the Authenticode signature at load time to create Publisher evidence for the assembly. 但是,默认情况下,大多数应用程序不需要Publisher证据。However, by default, most applications do not need Publisher evidence. 标准 CAS 策略不依赖于PublisherMembershipConditionStandard CAS policy does not rely on the PublisherMembershipCondition. 应避免与验证发布者签名,除非你的应用程序使用的自定义 CA 策略的计算机上执行,或要满足的需求关联的不必要的启动成本PublisherIdentityPermission在部分信任环境中。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.)

备注

我们建议服务使用<generatePublisherEvidence>元素以提高启动性能。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

下面的示例演示如何使用<generatePublisherEvidence>要禁用检查应用程序的 CA 发布服务器策略元素。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