This documentation is archived and is not being maintained.

File specified in FileName is not a valid XML file 

The file name you supplied is not a valid XML file. To specify the allowable structure and content of an XML document, you can use a Document Type Definition (DTD), a Microsoft XML-Data Reduced (XDR) schema, or an XML Schema definition language (XSD) schema. XSD schemas are the preferred way to specify XML grammars in the .NET Framework.

NoteNote

In previous versions of Visual Studio 2005, the XML Designer is the designer for typed datasets and XML schema. The XML Designer can still be used to create and edit XML schema files. However, in Visual Studio 2005, the designer for creating and editing typed datasets is the Dataset Designer. For more information, see Dataset Designer.

To correct this error

  • Check that you are supplying the correct file name.

  • Check that the specified file contains valid XML by loading the XML file you want to check into the XML Designer. From the XML menu, choose Validate XML. Errors are displayed in the Task List.

  • If the XML file has an associated XML Schema, check that the elements appear in the defined structure and that the content of the individual elements conforms to the declared data types specified in the schema.

See Also

Show: