System.Xml.Serialization.XmlSerializer.GetXmlSerializerAssemblyName C# (CSharp) Method

GetXmlSerializerAssemblyName() public static method

public static GetXmlSerializerAssemblyName ( Type type, string defaultNamespace ) : string
type System.Type
defaultNamespace string
return string
        public static string GetXmlSerializerAssemblyName(Type type, string defaultNamespace)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            return Compiler.GetTempAssemblyName(type.GetTypeInfo().Assembly.GetName(), defaultNamespace);
        }

Same methods

XmlSerializer::GetXmlSerializerAssemblyName ( Type type ) : string

Usage Example

Ejemplo n.º 1
0
 /// <summary>Returns the name of the assembly that contains the serializer for the specified type in the specified namespace.</summary>
 /// <returns>The name of the assembly that contains specially built serializers.</returns>
 /// <param name="type">The <see cref="T:System.Type" /> you are interested in.</param>
 /// <param name="defaultNamespace">The namespace of the type.</param>
 public static string GetXmlSerializerAssemblyName(Type type, string defaultNamespace)
 {
     return(XmlSerializer.GetXmlSerializerAssemblyName(type) + "." + defaultNamespace.GetHashCode());
 }