diff --git a/dotnet/src/dotnetframework/GxClasses/Helpers/XMLHelper.cs b/dotnet/src/dotnetframework/GxClasses/Helpers/XMLHelper.cs index 0a2769cc6..6a98b2ecc 100644 --- a/dotnet/src/dotnetframework/GxClasses/Helpers/XMLHelper.cs +++ b/dotnet/src/dotnetframework/GxClasses/Helpers/XMLHelper.cs @@ -82,7 +82,10 @@ public static T Deserialize(Type TargetType, string serialized, string sName, { using (StringReader sr = new StringReader(serialized)) { - deserialized = (T)(xmls.Deserialize(sr)); + using (XmlReader xmlReader = XmlReader.Create(sr, new XmlReaderSettings {CheckCharacters=false })) + { + deserialized = (T)(xmls.Deserialize(xmlReader)); + } } } catch (InvalidOperationException ex) @@ -163,13 +166,14 @@ internal static string Serialize(string rootName, string sNameSpace, XmlAttribut string s; using (MemoryStream stream = new MemoryStream()) { - XmlWriter xmlw = XmlWriter.Create(stream, new System.Xml.XmlWriterSettings() + XmlWriter xmlw = XmlWriter.Create(stream, new XmlWriterSettings() { OmitXmlDeclaration = !includeHeader, Indent = indentElements, IndentChars = "\t", - Encoding = Encoding.UTF8 - }); + Encoding = Encoding.UTF8, + CheckCharacters = false + }); XmlSerializerNamespaces xmlns = new XmlSerializerNamespaces(); xmlns.Add(string.Empty, sNameSpace); xmls.Serialize(xmlw, instance, xmlns);