<bypassTrustedAppStrongNames> 元素<bypassTrustedAppStrongNames> Element

指定是否在加载到完全信任的完全信任程序集上绕过强名称验证 AppDomainSpecifies whether to bypass the validation of strong names on full-trust assemblies that are loaded into a full-trust AppDomain.

<configuration>
  <runtime>
    <bypassTrustedAppStrongNames>

语法Syntax

<bypassTrustedAppStrongNames
   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 bypass feature that avoids validating strong names for full-trust assemblies is enabled. 当启用此功能时,加载程序集时,不会验证强名称是否正确。When this feature is enabled, strong names are not validated for correctness when the assembly is loaded. 默认为 trueThe default is true.

enabled 特性enabled Attribute

Value 说明Description
true 将程序集加载到完全信任时,不会验证完全信任程序集上的强名称签名 AppDomainStrong-name signatures on full-trust assemblies are not validated when the assemblies are loaded into a full-trust AppDomain. 这是默认设置。This is the default.
false 将程序集加载到完全信任时,会验证完全信任程序集上的强名称签名 AppDomainStrong-name signatures on full-trust assemblies are validated when the assemblies are loaded into a full-trust AppDomain. 仅对签名正确性检查强名称签名;与另一个匹配的强名称没有比较。The strong-name signature is checked only for signature correctness; it is not compared to another strong name for a match.

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

强名称跳过功能可避免完全信任程序集的强名称签名验证的系统开销。The strong-name bypass feature avoids the overhead of strong-name signature verification of full-trust assemblies.

跳过功能适用于使用强名称进行签名及具有以下特征的任何程序集:The bypass feature applies to any assembly that is signed with a strong name and that has the following characteristics:

  • 完全受信任,无需 StrongName 证据(如具有 MyComputer 区域证据)。Fully trusted without the StrongName evidence (for example, has MyComputer zone evidence).

  • 加载到完全受信任的 AppDomainLoaded into a fully trusted AppDomain.

  • 加载自该 AppDomainApplicationBase 属性下的某个位置。Loaded from a location under the ApplicationBase property of that AppDomain.

  • 签名没有延迟。Not delay-signed.

备注

如果对计算机上的所有应用程序使用注册表项关闭了绕过功能,则此配置文件设置将不起作用。If the bypass feature has been turned off for all applications on the computer by using a registry key, this configuration file setting has no effect. 有关详细信息,请参阅如何:禁用强名称跳过功能For more information, see How to: Disable the Strong-Name Bypass Feature.

示例Example

下面的示例演示如何指定对完全信任程序集的强名称签名进行验证的行为。The following example shows how to specify the behavior that validates the strong-name signature on full-trust assemblies.

<configuration>
   <runtime>
      <bypassTrustedAppStrongNames enabled="false"/>
   </runtime>
</configuration>

另请参阅See also