How to fix "Root element is missing." when doing a Visual Studio (VS) Build?
Any idea what file I should look at in my solution?
Actually, I am getting this error message inside of "Visual Build Pro" when using using the "Make VS 2008" command. This command works just fine when building other solutions (like about 20) and I am not really sure why mine is getting the error.
Any help would be very much appreciated. :)
I am using VS 2008 and Visual Build Pro 6.7.
Make sure any XML file (or any file that would be interpreted as an XML file by visual studio) has a correct XML structure - that is, one root element (with any name, I have use
rootElement
in my example):I got this issue on a Web API project. Finally figured out that it was in my "///" method comments. I have these comments set to auto-generate documentation for the API methods. Something in my comments made it go crazy. I deleted all the carriage returns, special characters, etc. Not really sure which thing it didn't like, but it worked.
I had a few massive VS2015 Community crashes.
which were full of null characters, and also these
In my case, i was using vs 2010 with crystal report. Innerexception revealed root element is missing error. Go to directory like C:\Users\sam\AppData\Local\dssms\dssms.vshost.exe_Url_uy5is55gioxym5avqidulehrfjbdsn13\1.0.0.0 which is given in the innermessage and make sure user.config is proper XML (mine was blank for some reason).
In my case the RDLC files work with resource files (.resx), I had this error because I hadn't created the correspondent resx file for my rdlc report.
My solution was add the file .resx inside the App_LocalResources in this way:
I had the same problem in a Xamarin Forms project. iOS project was unavailable and I couldn't reload the project. I was looking for a solution that doesn't need uninstalling anything.
The answer I got from this blog: https://dev.to/codeprototype/xamarin-form-application-failed-to-load-android-project-root-element-missing--27o0
So without uninstalling anything, you could delete the .csproj.user file (or rename it) so Visual Studio will create the file again. Worked for me twice.