Export (0) Print
Expand All

<knownType>

Specifies a type to be used by DataContractSerializer during deserialization. The element specifies a "known type" that is returned by a field or property of a "declared type." For more information, see Data Contract Known Types.


<knownType type="String">
     <parameter index="Integer"
                type="String" />
</knownType>

string

The following sections describe attributes, child elements, and parent elements.

Attributes

 

Attribute Description

type

Specifies the type (including namespace), assembly name, version, culture, and public key token.

Child Elements

 

Element Description

<parameter>

Specifies a parameter index when the declared type is a generic type.

Parent Elements

 

Element Description

<add> of <declaredTypes> Element

Adds a declared type to the collection of declared types.

For more information about known types, see Data Contract Known Types and DataContractSerializer.

See the <dataContractSerializer> for an example of using this element.

<add type="MyCompany.Library.Shape, 
           MyAssembly, Version=2.0.0.0, Culture=neutral,
           PublicKeyToken=XXXXXX, processorArchitecture=MSIL">
           <knownType type="MyCompany.Library.Circle, 
                      MyAssembly, Version=2.0.0.0, Culture=neutral,
                      PublicKeyToken=XXXXXX,
                      processorArchitecture=MSIL"/>
</add>




Build Date:

2012-08-02

Community Additions

ADD
Show:
© 2014 Microsoft