When attempting to use components generated using the XML Schema Generator an error similiar to the following may be encountered.
System.InvalidOperationException: There is an error in XML document (1, 23). ---> System.InvalidOperationException: <LinkResources xmlns=''> was not expected.
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
at Generated.Graham_XML_Generator.linkRead.Run(IData data)
In all instances where this has been seen the cause of the issue is the XML schema file (XSD file) used in the component generation not being formatted properly for the XML file being read by the component.
The solution is to generate a new XSD file using the XML file you are attempting to parse as a template. Once this has been done, recreate the XML Schema Generator components using the new XSD file.Generating a new XSD file can be accomplished using Microsoft Visual Studio 2005 or 2008 using the instructions below. Note: If you do not have Visual Studio the free Express versions that Microsoft offers can be used as well.