0

I have this object AMForm with dictionary as one of its property.

public class AMForm
{
    public string Title { get; set; }
    public string Description { get; set; }
    public Dictionary<string, string> FormValues { get; set; }
}

XmlSerializer seems unable to serialize the dictionary property.

hendryanw
  • 1,819
  • 5
  • 24
  • 39
Tom Mabaquiao
  • 779
  • 7
  • 10
  • Do you want to serialize it to JSON or XML? Have you managed to serialize other types of objects than *Dictionary* or are you stuck on serialization in general? Errors/issues? – Konrad Viltersten Sep 29 '16 at 10:36
  • There's plenty of threads here with that question already. Anyway, possibly you can find your answer here: http://weblogs.asp.net/pwelter34/444961 – JFM Sep 29 '16 at 10:36
  • I having this exception : An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.dll – Tom Mabaquiao Sep 29 '16 at 10:39
  • I have change the property public Dictionary FormValues { get; set; } to public SerializableDictionary FormValues { get; set; } Thanks! – Tom Mabaquiao Sep 29 '16 at 10:49

0 Answers0