<新增 > 項目<schemaImporterExtensions ><add> Element for <schemaImporterExtensions>

加入 XmlSchemaImporter 使用的型別,將 XSD 型別對應至 .NET Framework 型別。Adds types used by the XmlSchemaImporter for mapping XSD types to .NET Framework types. 如需組態檔的詳細資訊,請參閱組態檔結構描述For more information about configuration files, see Configuration File Schema.

<configuration><configuration>
<system.xml.serialization><system.xml.serialization>
<schemaImporterExtensions><schemaImporterExtensions>
<add><add>

語法Syntax

<add name = "typeName" type="fully qualified type [,Version=version number] [,Culture=culture] [,PublicKeyToken= token]"/>  

屬性和項目Attributes and Elements

下列各節描述屬性、子項目和父項目。The following sections describe attributes, child elements, and parent elements.

屬性Attributes

屬性Attribute 描述Description
namename 用來尋找執行個體的簡單名稱。A simple name that is used to find the instance.
typetype 必要項。Required. 指定要加入的結構描述擴充功能類別。Specifies the schema extension class to add. type 屬性值必須在同一行,且包括完整類型名稱。The type attribute value must be on one line, and include the fully qualified type name. 當組件置於全域組件快取 (GAC) 中時,也必須包含簽署組件的版本、文化特性和公開金鑰語彙基元。When the assembly is placed in the Global Assembly Cache (GAC), it must also include the version, culture, and public key token of the signed assembly.

子元素Child Elements

無。None.

父項目Parent Elements

項目Element 描述Description
<schemaImporterExtensions><schemaImporterExtensions> 包含 XmlSchemaImporter 使用的型別。Contains the types that are used by the XmlSchemaImporter.

範例Example

下列程式碼範例會加入 XmlSchemaImporter 在對應型別時可使用的副檔名類型。The following code example adds an extension type that the XmlSchemaImporter can use when mapping types.

<configuration>  
  <system.xml.serialization>  
    <schemaImporterExtensions>  
       <add name="contoso" type="System.Web.Mobile.MobileCapabilities,   
       System.Web.Mobile, Version=2.0.0.0, Culture=neutral,   
       PublicKeyToken=b03f5f7f11d50a3a" />   
    </schemaImporterExtensions>  
  </system.xml.serialization>  
</configuration>  

另請參閱See also