<configuration> 的 <assemblyBinding> 元素

指定配置级的程序集绑定策略。

<assemblyBinding  
   xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>

特性和元素

以下几节描述了属性、子元素和父元素。

特性

特性

说明

xmlns

必选特性。

指定程序集绑定所需的 XML 命名空间。 使用字符串“urn:schemas-microsoft-com:asm.v1”作为值。

子元素

元素

说明

<linkedConfiguration> 元素

指定要包含的配置文件。

父元素

元素

说明

<configuration> 元素

公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。

备注

<linkedConfiguration> 元素 允许应用程序配置文件包含已知位置的程序集配置文件,而不是复制程序集配置设置,从而简化了组件程序集的管理。

注意注意

具有 Windows 并行清单的应用程序不支持 <linkedConfiguration> 元素。

示例

下面的代码示例演示如何包含本地硬盘上的配置文件。

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

请参见

其他资源

.NET Framework 的配置文件架构