Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,14 @@ private static XmlSerializer[] GetReflectionBasedSerializers(XmlMapping[] mappin
[UnconditionalSuppressMessage("SingleFile", "IL3000: Avoid accessing Assembly file path when publishing as a single file",
Justification = "Code is used on diagnostics so we fallback to print assembly.FullName if assembly.Location is empty")]
internal static bool GenerateSerializer(Type[]? types, XmlMapping[] mappings, Stream stream)
{
return GenerateSerializer(types, mappings, null, stream);
}

[RequiresUnreferencedCode("calls GenerateSerializerToStream")]
[UnconditionalSuppressMessage("SingleFile", "IL3000: Avoid accessing Assembly file path when publishing as a single file",
Justification = "Code is used on diagnostics so we fallback to print assembly.FullName if assembly.Location is empty")]
internal static bool GenerateSerializer(Type[]? types, XmlMapping[] mappings, string? defaultNamespace, Stream stream)
{
if (types == null || types.Length == 0)
return false;
Expand Down Expand Up @@ -669,7 +677,7 @@ internal static bool GenerateSerializer(Type[]? types, XmlMapping[] mappings, St
}
}

return TempAssembly.GenerateSerializerToStream(mappings, types, null, assembly, new Hashtable(), stream);
return TempAssembly.GenerateSerializerToStream(mappings, types, defaultNamespace, assembly, new Hashtable(), stream);
}

[RequiresUnreferencedCode("calls Contract")]
Expand Down