Прочетете на английски Редактиране

Споделяне чрез


XmlSerializer.GetXmlSerializerAssemblyName Method

Definition

Returns the name of the assembly that contains one or more versions of the XmlSerializer especially created to serialize or deserialize specific types.

Overloads

GetXmlSerializerAssemblyName(Type)

Returns the name of the assembly that contains one or more versions of the XmlSerializer especially created to serialize or deserialize the specified type.

GetXmlSerializerAssemblyName(Type, String)

Returns the name of the assembly that contains the serializer for the specified type in the specified namespace.

Remarks

The XML Serializer Generator Tool (Sgen.exe) creates an XML serialization assembly for types in a specified assembly to improve the run-time performance of an XmlSerializer when it serializes or deserializes objects of the specified types. Use the GetXmlSerializerAssemblyName to return the name of such an assembly.

If you are distributing such an assembly as part of a client application that calls a Web service, you can apply the XmlSerializerAssemblyAttribute to the client type to specify the location and name of the assembly.

GetXmlSerializerAssemblyName(Type)

Source:
XmlSerializer.cs
Source:
XmlSerializer.cs
Source:
XmlSerializer.cs

Returns the name of the assembly that contains one or more versions of the XmlSerializer especially created to serialize or deserialize the specified type.

C#
public static string GetXmlSerializerAssemblyName(Type type);

Parameters

type
Type

The Type you are deserializing.

Returns

The name of the assembly that contains an XmlSerializer for the type.

Remarks

The XML Serializer Generator Tool (Sgen.exe) creates an XML serialization assembly for types in a specified assembly to improve the run-time performance of an XmlSerializer when it serializes or deserializes objects of the specified types. Use the GetXmlSerializerAssemblyName to return the name of such an assembly.

If you are distributing such an assembly as part of a client application that calls a Web service, you can apply the XmlSerializerAssemblyAttribute to the client type to specify the location and name of the assembly.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

GetXmlSerializerAssemblyName(Type, String)

Source:
XmlSerializer.cs
Source:
XmlSerializer.cs
Source:
XmlSerializer.cs

Returns the name of the assembly that contains the serializer for the specified type in the specified namespace.

C#
public static string GetXmlSerializerAssemblyName(Type type, string? defaultNamespace);
C#
public static string GetXmlSerializerAssemblyName(Type type, string defaultNamespace);

Parameters

type
Type

The Type you are interested in.

defaultNamespace
String

The namespace of the type.

Returns

The name of the assembly that contains specially built serializers.

Remarks

The XML Serializer Generator Tool (Sgen.exe) creates an XML serialization assembly for types in a specified assembly to improve the run-time performance of an XmlSerializer when it serializes or deserializes objects of the specified types. Use the GetXmlSerializerAssemblyName to return the name of such an assembly.

If you are distributing such an assembly as part of a client application that calls a Web service, you can apply the XmlSerializerAssemblyAttribute to the client type to specify the location and name of the assembly.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1