XML file name
<?XML version= "1.0" encoding= "Utf-8"?><ConfigXmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd= "Http://www.w3.org/2001/XMLSchema"> <Enabled>True</Enabled> <ServerURL>Http://127.0.01/Version.xml</ServerURL> <updatefilelistUpdateInfo= "Update description information"> <LocalFileFileName= "Bb.exe"FileVersion="" /> </updatefilelist></Config>
Program code
New XmlSerializer (typeof(configuration)); New StreamWriter (file); This ); StreamWriter.Close ();
Error occurred
Error in XML document (2, 2): Should not <xml xmlns= ' >
The reason for this is that the root node (Config) of the XML cannot be deserialized because it is not the same as the object name (configuration), as long as one of the names is changed to be the same as the other .
There is an error in the XML document (2, 2): There should be no <xml xmlns= ' > ' Error