I'm using Visual Web Developer to build a Silverlight Class Library. I have another project where the Class Library is imported and implemented. It's loading an XML file and I'm using XmlSerializer.Deserialize into a class I created with xsd.exe.
Sometimes, when loading the XML, I get this error:
Unhandled Error in Silverlight 2 Application Code: 4004 Category: ManagedRuntimeError Message: System.InvalidOperationException: There is an error in XML document (149, 10). ---> System.NotSupportedException: XLinq at System.Xml.Serialization.XmlSerializationReader.ReadXmlNodes(Boolean elementCanBeType) at System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualifiedName type, Boolean elementCanBeType) at System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualifiedName type)
I've discovered that it only occurs when there is a tag called Extensions in my XML file. At first I thought this was improperly defined in the C# class generated by xsd.exe, but it works if I change Extensions to any other name. Unfortunately, simply changing the name of this tag permanently is not an option. I've ruled out reserved words. Google has no info on this error.