Skip to content

Commit cb116e1

Browse files
author
Michael Ganss
committed
base64Binary and hexBinary don't work for xs:list attributes
1 parent 3bf7663 commit cb116e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

XmlSchemaClassGenerator/CodeUtilities.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,11 @@ public static Type GetEffectiveType(this XmlSchemaDatatype type, GeneratorConfig
170170
// XmlSerializer doesn't support xsd:list for elements, only for attributes:
171171
// https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/t84dzyst(v%3dvs.100)
172172

173-
// Also, de/serialization fails when the XML schema type is ambiguous (DateTime -> date, datetime, or time)
173+
// Also, de/serialization fails when the XML schema type is ambiguous
174+
// DateTime -> date, datetime, or time
175+
// byte[] -> hexBinary or base64Binary
174176

175-
if (!attribute || resultType == typeof(DateTime))
177+
if (!attribute || resultType == typeof(DateTime) || resultType == typeof(byte[]))
176178
resultType = typeof(string);
177179
}
178180

0 commit comments

Comments
 (0)