XmlSerializer.GetXmlSerializerAssemblyName 方法

定义

返回程序集的名称,该程序集包含专门为序列化或反序列化特定类型创建的 XmlSerializer 的一个或多个版本。Returns the name of the assembly that contains one or more versions of the XmlSerializer especially created to serialize or deserialize specific types.

重载

GetXmlSerializerAssemblyName(Type)

返回程序集的名称,该程序集包含专门为序列化或反序列化特定类型创建的 XmlSerializer 的一个或多个版本。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.

注解

XML 序列化程序生成器工具(Sgen)为指定程序集中的类型创建 XML 序列化程序集,以便在序列化或反序列化指定类型的对象时提高 XmlSerializer 的运行时性能。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. 使用 GetXmlSerializerAssemblyName 返回此类程序集的名称。Use the GetXmlSerializerAssemblyName to return the name of such an assembly.

如果要将此类程序集作为调用 Web 服务的客户端应用程序的一部分进行分发,则可以将 XmlSerializerAssemblyAttribute 应用于客户端类型以指定程序集的位置和名称。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)

返回程序集的名称,该程序集包含专门为序列化或反序列化特定类型创建的 XmlSerializer 的一个或多个版本。Returns the name of the assembly that contains one or more versions of the XmlSerializer especially created to serialize or deserialize the specified type.

public:
 static System::String ^ GetXmlSerializerAssemblyName(Type ^ type);
public static string GetXmlSerializerAssemblyName (Type type);
static member GetXmlSerializerAssemblyName : Type -> string
Public Shared Function GetXmlSerializerAssemblyName (type As Type) As String

参数

type
Type

正在进行反序列化的 TypeThe Type you are deserializing.

返回

包含该类型的 XmlSerializer 的程序集的名称。The name of the assembly that contains an XmlSerializer for the type.

注解

XML 序列化程序生成器工具(Sgen)为指定程序集中的类型创建 XML 序列化程序集,以便在序列化或反序列化指定类型的对象时提高 XmlSerializer 的运行时性能。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. 使用 GetXmlSerializerAssemblyName 返回此类程序集的名称。Use the GetXmlSerializerAssemblyName to return the name of such an assembly.

如果要将此类程序集作为调用 Web 服务的客户端应用程序的一部分进行分发,则可以将 XmlSerializerAssemblyAttribute 应用于客户端类型以指定程序集的位置和名称。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, String)

返回程序集的名称,该程序集包含指定命名空间中指定类型的序列化程序。Returns the name of the assembly that contains the serializer for the specified type in the specified namespace.

public:
 static System::String ^ GetXmlSerializerAssemblyName(Type ^ type, System::String ^ defaultNamespace);
public static string GetXmlSerializerAssemblyName (Type type, string defaultNamespace);
static member GetXmlSerializerAssemblyName : Type * string -> string
Public Shared Function GetXmlSerializerAssemblyName (type As Type, defaultNamespace As String) As String

参数

type
Type

您关注的 TypeThe Type you are interested in.

defaultNamespace
String

类型的命名空间。The namespace of the type.

返回

程序集的名称,该程序集包含专门生成的序列化程序。The name of the assembly that contains specially built serializers.

注解

XML 序列化程序生成器工具(Sgen)为指定程序集中的类型创建 XML 序列化程序集,以便在序列化或反序列化指定类型的对象时提高 XmlSerializer 的运行时性能。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. 使用 GetXmlSerializerAssemblyName 返回此类程序集的名称。Use the GetXmlSerializerAssemblyName to return the name of such an assembly.

如果要将此类程序集作为调用 Web 服务的客户端应用程序的一部分进行分发,则可以将 XmlSerializerAssemblyAttribute 应用于客户端类型以指定程序集的位置和名称。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.

适用于