public static string GetXmlSerializerAssemblyName(Type type, string defaultNamespace) { if (type == null) { throw new ArgumentNullException(nameof(type)); } return Compiler.GetTempAssemblyName(type.GetTypeInfo().Assembly.GetName(), defaultNamespace); }
/// <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()); }