I'm using C# (WPF).
I have the following XML file:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationToRun IsFromXML="true">
<Apps>
<FulllPath>c:\file1.txt</FullPath>
<FulllPath>c:\file2.txt</FullPath>
<FulllPath>c:\file3.txt</FullPath>
</Apps>
</ApplicationToRun>
And i try to deseriazlier the xml file.
My Code:
mlSerializer xs = new XmlSerializer(typfof(MyXMLClass));
StringReader st = new StringReader(xmlPath);
MyXMLClass apps = (MyXMLClass)xs.Deserialize(st); //Exception - System.Windows.Markup.XamlParseException
Inside the inner exception: System.InvalidOperationException :There is an error in XML document (1.1) ...
My Classes:
[XmlRootAttriute("ApplicationToRun:)
public class MyXMLClass
{
[XmlAttribute]
public bool IsFromXML {get;set;}
[XmlElement("Apps")]
public FullPath [] fullPath {get;set;}
}
public class FullPath
{
public stirng fullPathApp {set;get;}
}
Where is my mistake?
Thanks!