I'm going nuts trying to simply work with xml file in Visual Studio 2005. If I create a new *.xml file and add it to the project then a gray screen gets displayed instead of the file contents. This screen shows the message "This XML document is not well formed. It contains the following error: Root element is missing". It seems like the XML tools build into Visual Studio 2005 have hijacked this file and it's now impossbile to simply look at the file and manipulate like any other text based file. There is a clunky work around where I do a right click open it with HTML editor. I'm able to work with XML files with no such problems on my machine at work which has Visual Studio 2008.
A:
Try do a add the File via the menu. File->New File-> XML File.
Alternatively you could try to add some kind of root node yourself like: . (To do that open the file with notepad.)
Robert
2010-02-27 14:21:22
I get the same behavior off the File->New File menu. If I do a right click open with Source Code (Text) Editor then it's like viewing it in Notepad. That works better than viewing with the HTML Editor which shows all sorts of errors because it's thinking this file is supposed to be following HTML formatting rules. On VS 2008 an XML file comes up with nice color coded syntax highlighting but I guess I'll just have to settel for the simple NotePad view.
JoeT
2010-02-27 14:32:15
+1
A:
It looks like you've lost association with your default xml template or xml editor. When you click "Open With", do you see the Xml Editor or Xml Schema Editor at all? These should both be available to you. You may need to perform a restore on these templates.
Joel Etherton
2010-02-27 14:28:34
I was getting the Xml Editor on a right click "Open With" but that brought up above mentioned the gray screen.
JoeT
2010-02-27 17:03:57