Visual Studio .NET - Xml file runs fine in VS2008 but in VS2010 error: Invalid at top level of document.

Asked By Pranay on 19-Sep-12 10:46 AM
I've an xml file which when I run from VS 2008 runs fine but when I try the same from VS 2010 I am getting this error:Invalid at the top level of the document. Error processing resource. Cannot view xml input using style sheet.
Now I don't think there is anything wrong with my xml file otherwise it would not open in VS2008 but I can't think of a resaon why it doesn't work through VS2010 while all other parameters remain the same.
Any suggestions are welcome
thanks
Robbe Morris replied to Pranay on 19-Sep-12 11:17 AM
Can you open the XML file in Internet Explorer?
Pranay replied to Robbe Morris on 19-Sep-12 12:53 PM
Yes, I can open it in IE.
Thanks
Robbe Morris replied to Pranay on 19-Sep-12 01:05 PM
Hmm, my guess is that there is an invisible character that might be throwing Visual Studio off.  You could try manually deleting the first few characters and typing them over again.  Seems odd but I have run into this weird situation before.
Pranay replied to Robbe Morris on 19-Sep-12 01:18 PM
I applied a better trick... went out and had lunch, come back and just tried it again and it works !!!  VS can be so moody at times. Anyways, thanks for your help. I appreciate it.