<用于<配置>的程序集绑定>元素<assemblyBinding> element for <configuration>

指定配置级的程序集绑定策略。Specifies assembly binding policy at the configuration level.

 <配置> 程序集绑定><<configuration>   <assemblyBinding>

语法Syntax

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <!-- Configuration files to include. -->
</assemblyBinding>

AttributeAttribute

说明Description
xmlnsxmlns 必需的特性。Required attribute.

指定程序集绑定所需的 XML 命名空间。Specifies the XML namespace required for assembly binding. 使用字符串“urn: 架构-microsoft-com:asm.v1”作为值。Use the string "urn:schemas-microsoft-com:asm.v1" as the value.

父元素Parent element

说明Description
<配置><configuration> 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.

子元素Child element

说明Description
<链接配置><linkedConfiguration> 指定要包含的配置文件。Specifies a configuration file to include.

备注Remarks

<链接配置>元素允许应用程序配置文件在已知位置包含程序集配置文件,而不是复制程序集配置设置,从而简化了组件程序集的管理。The <linkedConfiguration> element simplifies the management of component assemblies by allowing application configuration files to include assembly configuration files in well-known locations, rather than duplicating assembly configuration settings.

备注

对于具有 Windows 并行清单的应用程序,不支持**<链接的配置>** 元素。The <linkedConfiguration> element is not supported for applications with Windows side-by-side manifests.

示例Example

下面的示例演示如何在本地硬盘上包含配置文件:The following example shows how to include a configuration file on the local hard disk:

<configuration>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <linkedConfiguration href="file://c:\Program Files\Contoso\sharedConfig.xml" />
  </assemblyBinding>
</configuration>

另请参阅See also