<relativeBindForResources > 元素<relativeBindForResources> Element

优化附属程序集的探测。Optimizes the probe for satellite assemblies.

<配置 > 元素<configuration> Element
<运行时 > 元素<runtime> Element
<relativeBindForResources > 元素<relativeBindForResources> Element

语法Syntax

<relativeBindForResources    
   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 common language runtime optimizes the probe for satellite assemblies.

enabled 特性enabled Attribute

Value 描述Description
false 在运行时不会优化附属程序集的探测。The runtime does not optimize the probe for satellite assemblies. 这是默认值。This is the default value.
true 在运行时优化附属程序集探测。The runtime optimizes the probe for satellite assemblies.

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

一般情况下,资源管理器探测的资源,如中所述打包和部署资源主题。In general, Resource Manager probes for resources, as documented in the Packaging and Deploying Resources topic. 这意味着,当资源管理器探测程序特定的本地化版本的资源,它可能会在全局程序集缓存中查找、 在应用程序代码基,查询 Windows 安装程序的特定于区域性的文件夹中查找的附属程序集,并引发AppDomain.AssemblyResolve事件。This means that when Resource Manager probes for a particular localized version of a resource, it may look in the global assembly cache, look in a culture-specific folder in the application's code base, query Windows Installer for satellite assemblies, and raise the AppDomain.AssemblyResolve event. <relativeBindForResources>元素对中的资源管理器探测附属程序集的方式进行优化。The <relativeBindForResources> element optimizes the way in which Resource Manager probes for satellite assemblies. 在以下情况下的资源探测时,它可以提高性能:It can improve performance when probing for resources under the following conditions:

  • 当附属程序集部署在与代码程序集相同的位置。When the satellite assembly is deployed in the same location as the code assembly. 换而言之,如果代码程序集安装在全局程序集缓存,附属程序集必须也那里安装。In other words, if the code assembly is installed in the global assembly cache, the satellite assemblies must also be installed there. 如果代码程序集安装在应用程序的基本代码,那么还必须在基本代码的特定于区域性的文件夹中安装附属程序集。If the code assembly is installed in the application's code base, the satellite assemblies must also be installed in a culture-specific folder in the code base.

  • Windows 安装程序时未使用或只是偶尔使用按需安装附属程序集。When Windows Installer is not used or is used only rarely for on-demand installation of satellite assemblies.

  • 当应用程序代码不会处理AppDomain.AssemblyResolve事件。When application code does not handle the AppDomain.AssemblyResolve event.

设置enabled的属性<relativeBindForResources>元素true优化资源管理器的探测附属程序集,如下所示:Setting the enabled attribute of the <relativeBindForResources> element to true optimizes Resource Manager's probe for satellite assemblies as follows:

  • 它使用父代码程序集的位置来探测附属程序集。It uses the location of the parent code assembly to probe for the satellite assembly.

  • 它不会查询 Windows 安装程序的附属程序集。It does not query Windows Installer for satellite assemblies.

  • 它不会引发AppDomain.AssemblyResolve事件。It does not raise the AppDomain.AssemblyResolve event.

请参阅See also