c# - Xml without root deserialization -


i have xml looks

 <root> <logentry>     <data1> </data1>     <data2> </data2> </logentry> <logentry>     <data1> </data1>     <data2> </data2> </logentry>  </root> 

and class looks

[xmlroot("root")] public class logentries {     [xmlelement("logentry")]     public list<clientlogentry> entries { get; set; }      public clientlogentries()     {         entries = new list<clientlogentry>();     } } 

where clientlogentry has properties inside logentry node.

var serializer = new xmlserializer(typeof(logentries)); var entries= (logentries)serializer.deserialize(this.taskdefinition.xmlstream); 

it says <root xmlns=''> not expected. idea change?


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -