<configuration> 的 <assemblyBinding> 項目<assemblyBinding> element for <configuration>

指定位於組態層級的組件繫結原則。Specifies assembly binding policy at the configuration level.

<configuration>   <assemblyBinding><configuration>   <assemblyBinding>

語法Syntax

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

屬性Attribute

描述Description
xmlnsxmlns 必要屬性。Required attribute.

指定組件繫結所需的 XML 命名空間。Specifies the XML namespace required for assembly binding. 使用字串 "urn:schemas-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

<linkedConfiguration>元素藉由允許應用程式佈建檔在已知位置中包含元件設定檔,而不是複製元件設定,來簡化元件元件的管理。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.

注意

<linkedConfiguration> 具有 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