No spaces in name of XElement
Error Message:
This is because I had used:System.Xml.XmlException: The ' ' character, hexadecimal value 0x20, cannot be included in a name.
XElement root = new XElement("List Of Members", e1, e2, e3);... which should have been:
XElement root = new XElement("ListOfMembers", e1, e2, e3);
Parameterless Constructor
Error Message:cannot be serialized because it does not have a parameterless constructorThis was because I was trying to return a variable of type XDocument which does not have a parameterless constructor. I then tried return specific classes, but still received this error because my classes did not have parameterless constructor.
Basically what the compiler is looking for is the follow:
public Class1The constructor can also be private or internal if you do not want to have a public parameterless constructor.
{
Class1()
{ }
}
No comments:
Post a Comment