467,859 Members | 1,354 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,859 developers. It's quick & easy.

"<root xmlns=''> was not expected." when DeSerialize from xml string

Hi,i am trying to DeSerialize the following class from an XML string
and i get "<root xmlns=''> was not expected."

public class Person
private string m_Name;
private string m_Phone;

public Person()


public string Name
get{return m_Name;}

public string Phone
get{return m_Phone;}
This is the DeSerialize code:

Person p;

System.Xml.Serialization.XmlSerializer ser=new
System.Xml.Serialization.XmlSerializer(typeof(Pers on),"");

//construct the XML

string xml="<?xml version='1.0' encoding='utf-16'?>"+





StringReader w =new StringReader(xml);




catch(Exception we)



Jul 21 '05 #1
  • viewed: 4982

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by S??rgio Nunes | last post: by
1 post views Thread by Christian Schmidbauer | last post: by
3 posts views Thread by Tjerk Wolterink | last post: by
5 posts views Thread by martin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.