I see your issue.
Your byte array is internal make it public
<pre lang="c#">
public byte[] FPTemplates { get; set; }
</pre>
Try giving this a Go I see you are converting your string to utf8 and then ascii in your serialisers
public static string SerializeObject<t>(T obj)
{
try
{
string xmlString = null;
MemoryStream memoryStream = new MemoryStream();
XmlSerializer xs = new XmlSerializer(typeof(T));
XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
xs.Serialize(xmlTextWriter, obj);
memoryStream = (MemoryStream)xmlTextWriter.BaseStream;
xmlString = Converters.ByteArrayToUTF8String(memoryStream.ToArray()); return xmlString;
}
catch
{
return string.Empty;
}
}
public static T DeserializeObject<t>(string xml)
{
XmlSerializer xs = new XmlSerializer(typeof(T));
MemoryStream memoryStream = new MemoryStream(Converters.StringToUTF8ByteArray(xml));
XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
return (T)xs.Deserialize(memoryStream);
}
public class Converters{
public static string ByteArrayToUTF8String(byte[] characters)
{
UTF8Encoding encoding = new UTF8Encoding();
string constructedString = encoding.GetString(characters);
return (constructedString);
}
public static Byte[] StringToUTF8ByteArray(string stringVal)
{
UTF8Encoding encoding = new UTF8Encoding();
byte[] byteArray = encoding.GetBytes(stringVal);
return byteArray;
}
}
</t></t>