[ACCEPTED]-How to deserialize into a List<String> using the XmlSerializer-xml-serialization
Accepted answer
Add a property like this to hold the list 5 of Components:
[XmlArray()]
public List<Component> Components { get; set; }
Edit: Sorry I misread that. You 4 want to read it into a collection of strings. I 3 just tried this below and it worked on your 2 sample. The key is just to setup the correct 1 xml serialization attributes.
public class ArsAction
{
[XmlArray]
[XmlArrayItem(ElementName="Component")]
public List<string> Components { get; set; }
}
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.