How to fix “Root element is missing.” when doing a Visual Studio (VS) Build?












53















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.










share|improve this question





























    53















    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.










    share|improve this question



























      53












      53








      53


      5






      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.










      share|improve this question
















      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.







      visual-studio-2010 visual-studio visual-studio-2008 visual-build-professional






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 29 '14 at 7:22









      Community

      11




      11










      asked Sep 22 '10 at 18:29









      Gerhard WeissGerhard Weiss

      3,973135565




      3,973135565
























          27 Answers
          27






          active

          oldest

          votes


















          29














          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):



          <?xml version="1.0"?> 
          <rootElement>
          ...
          </rootElement>





          share|improve this answer



















          • 1





            There are like thousands of files in my solution. Any special extensions to look at?

            – Gerhard Weiss
            Sep 22 '10 at 18:57






          • 3





            @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

            – Oded
            Sep 22 '10 at 19:09











          • Worked briefly, but had to use Kahlil's answer.

            – Eric Brown - Cal
            Feb 14 '17 at 17:43



















          36














          In my case it was the xxxxxxxxxxxx.vcxproj.user file that was causing the problem (it was blank) after a crash. I renamed it and the problem went away.






          share|improve this answer



















          • 13





            Deleted my .user file and it worked again.. It was also blank after a SVN update

            – TryingToImprove
            Oct 30 '15 at 13:49






          • 5





            In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

            – Garry
            Jan 2 '16 at 13:41



















          31














          You will also get 'root element is missing' when the BOM strikes :). BOM = byte order mark. This is an extra character that gets added to the start of a file when it is saved with the wrong encoding.

          This can happen sometimes in Visual Studio when working with XML files. You can either code something to remove it from all your files, or if you know which file it is you can force visual studio to save it with a specific encoding (utf-8 or ascii IIRC).



          If you open the file in an editor other than VS (try notepad++), you will see two funny characters before the <? xml declaration.



          To fix this in VS, open the file in VS and then depending on the version of VS




          • File > Advanced Save Options > choose an appropriate encoding

          • File > Save As > keep the filename, click the drop-down arrow on the right side of the save button to select an encoding






          share|improve this answer


























          • thank you you saved my day :)

            – HB MAAM
            Apr 17 '14 at 6:19



















          13














          In my case.I was getting missing element error pointing to NuGet.Config file.
          At that time it was looking some thing like this



          <?xml version="1.0" encoding="utf-8"?>
          <settings>
          <repositoryPath>Packages</repositoryPath>
          </settings>


          then I just added configuration tag that actually wraps entire xml. Now working fine for me



          <?xml version="1.0" encoding="utf-8"?>
          <configuration>
          <settings>
          <repositoryPath>Packages</repositoryPath>
          </settings>
          </configuration>





          share|improve this answer
























          • Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

            – cerberus
            Apr 15 '18 at 20:47



















          4














          I got same error. showing error Microsoft.Data.Entity could not loaded root element missing. When i delete that file from C:WindowsMicrosoft.NETFrameworkv4.0.30319 and again open my solution my problem was solved. Everything woks fine






          share|improve this answer































            4














            In my case, when I opened the .csproj file, it was empty so I went to my previous commit in git and copied the contents of that file and pasted it my current .csproj file. After which I deleted the .csproj.user file, reloaded my project, and everything started working again.






            share|improve this answer































              3














              In my case, the file C:UsersxxxAppDataLocalPreEmptive SolutionsDotfuscator Professional Edition4.0dfusrprf.xml was full of NULL.



              I deleted it; it was recreated on the first launch of Dotfuscator, and after that, normality was restored.






              share|improve this answer
























              • Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                – Dimo
                Aug 15 '16 at 10:54



















              3














              You can also search for the file. Navigate to your project directory with PowerShell and run Get-FileMissingRoot:



              function Get-FileMissingRoot {

              dir -recurse |
              where {
              ($_ -is [IO.FileInfo]) -and
              (@(".xml", ".config") -contains $_.extension)
              } |
              foreach {
              $xml = New-Object Xml.XmlDocument;
              $filename = $_.FullName
              try {
              $xml.Load($filename)
              }
              catch {
              write ("File: " + $filename)
              write ($_.Exception.Message)
              }
              }
              }





              share|improve this answer































                2














                This error can sometimes occur when you edit some Project Toolchain settings Atmel Studio 6.1.2730 SP2.



                In my case I tried to edit Project Properties > Toolchain > Linker > General settings with 'All Configurations' selected in the Configuration. When I checked or unchecked a setting, a dialog with the error popped up. However, I found that I could make the same edits if I made them to only one build configuration at a time; i.e. with only 'Debug' or 'Release' selected instead of 'All Configurations'.



                Interestingly, I later was able to edit the same Linker settings even with 'All Configurations' selected. I don't know what changed in my project that made this possible.






                share|improve this answer
























                • Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                  – hfrmobile
                  Feb 19 '14 at 9:26





















                2














                I had Blue Screen while running Visual Studio 2013, when I Restart I intended to run again my project, but I had always this headius Error.
                anyway



                Deleting The Folders with the Temp info Fix this problem.
                in my case the Project was a Windows Server, and Basically it Creates a Folder with some Tem info.



                the folder was



                C:UsersUser_NAMEAppDataLocalNAme_OF_THeProject


                inside Exist a Folder with the Name of the Project+ some Generated GUI
                Service.ServerHostLoader_Url_u2jn0xkgjf1th0a3i2v03ft15vj4x52i



                this is the Folder I deleted and now I can run again the Project.






                share|improve this answer

































                  1














                  In my case I upgraded to VS2017 and wanted to build all projects with MSBuild 4 with my build script (which had been using MSBuild 3.5 when we were using VS2015). That MSBuild upgrade appeared fine for the Windows desktop applications but the ones for Windows CE with compact framework would give me this confusing error. Reverting to MSBuild 3.5 for Windows CE projects fixed the issue for me.



                  I did have the BOM in .csproj files by the way and removed them for all projects in a solution that would not build but that did not help.






                  share|improve this answer































                    1














                    This error is caused by corrupted proj file.
                    Visual Studio allway has backup project file at specific folder.
                    Pls browse to:
                    C:Users\DocumentsVisual Studio Backup Files
                    You can see 2 file same as:
                    Original-May-18-2018-1209PM..csproj
                    Recovered-May-18-2018-1209PM..csproj



                    You only need copy file: Original-May-18-2018-1209PM..csproj
                    And re-name as .csproj & overide at root project folder.
                    Trouble is solved!






                    share|improve this answer
























                    • this was it. txs!

                      – smoore4
                      Feb 8 at 16:30



















                    1














                    I had this issue running VS 2017, on build I was getting the error that the 'root element was missing'. What solved it for me was going to Tools > Nuget Package Manager > Package Manager Settings > General > Clear all Nuget Caches. After doing that I ran the build again and it was fixed.






                    share|improve this answer































                      1














                      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.






                      share|improve this answer































                        0














                        Ho i simply solved this issue by going to source control explorer and selected the issue project, right clicked and selected the option Get Specific Version under Advanced menu. And then selected Type as Latest Version and ticked following two check boxes and clicked Get button. Then i refreshed the solution and my project came back to live and problem gone. Please note that This may overwrite your local projects so your current changes may lose. So if you dont have any issues with your local copy then you can try this. Hope it helps






                        share|improve this answer































                          0














                          This was easy to fix than I thought. All I did was clear the website cache folder.



                          Delete everything from



                          DRIVE LETTER OF OS:UsersUSER NAMEAppDataLocalMicrosoftWebsiteCache



                          example



                          C:UsersJackAppDataLocalMicrosoftWebsiteCache



                          For more visual studio tips please visit My Blog






                          share|improve this answer































                            0














                            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.






                            share|improve this answer































                              0














                              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:



                              rep
                              repmyreport.rdlc
                              repApp_LocalResourcesmyreport.rdlc.resx





                              share|improve this answer































                                0














                                I had a few massive VS2015 Community crashes.




                                Delete all the .csproj.user files




                                which were full of null characters, and also these




                                C:UsersUserNameAppDataLocalTemp



                                .NETFramework,Version=v4.0.AssemblyAttributes.cs
                                .NETFramework,Version=v4.5.AssemblyAttributes.cs
                                .NETFramework,Version=v4.5.2.AssemblyAttributes.cs







                                share|improve this answer































                                  0














                                  In my case I received a message like this:
                                  See this picture



                                  I just commented the snipped code below in the project file (.csproj) and the problem was fixed.



                                  <Import Project="$(MSBuildBinPath)Microsoft.CSharp.targets" />





                                  share|improve this answer

































                                    0














                                    In my case xxxx.pubxml.user was not loaded when tried to publish the application. I deleted the file and restart the Visual studio then created a new profile to publish it, problem is solved and published successfully.






                                    share|improve this answer































                                      0














                                      Hey, I have the same issue on Mac working on a Cocoa C# solution.
                                      (But I solved it !)



                                      It always say that the root element is missing so it cannot load my C# project file.



                                      I have the 2017 Visual Studio Mac Community Edition.
                                      I finally managed to find a solution after several hours (painful!).



                                      My solution is because the frameworks related to the Visual Studio are old or broken.
                                      I found this because I tried to create a new Mac solution by Cocoa and it said "failed to save the solution". Then, I tried to create an Android Solution and it is working fine.
                                      Go to your "Finder" and "Go" -> "Go to a Folder" then go to the "Library/Frameworks". I have deleted mono.framework and frameworks related to Xamarin because I believe these Xamarin frameworks are broken.



                                      Then, uninstalled the Visual Studio and reinstalled it.
                                      Now everything works fine!






                                      share|improve this answer































                                        0














                                        In my case, I got this error because of an empty packages.config file.
                                        This caused the NUGET package manager to fail and show the error Root element is missing.
                                        The resolution was to copy over elements from another non-empty file and then change it according to the needs.



                                        Example (packages.config):



                                        <?xml version="1.0" encoding="utf-8"?>
                                        <packages>
                                        <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451"/>
                                        <package id="Newtonsoft.Json" version="5.0.4" targetFramework="net451"/>
                                        </packages>





                                        share|improve this answer































                                          0














                                          In my case, i was using vs 2010 with crystal report. Innerexception revealed root element is missing error. Go to directory like C:UserssamAppDataLocaldssmsdssms.vshost.exe_Url_uy5is55gioxym5avqidulehrfjbdsn131.0.0.0 which is given in the innermessage and make sure user.config is proper XML (mine was blank for some reason).






                                          share|improve this answer































                                            0














                                            In xamarin form project. I deleted



                                            .VS Project folder.
                                            ProjectName.Android.csProj.User
                                            ProjectName.Android.csProj.bak





                                            share|improve this answer































                                              0














                                              In my case the problem occurred due to closing my PC while visual studio were remain open, so in result csproj.user file saved empty. Thankfully i have already backup, so i just copied all xml from csproj.user and paste in my affected project csproj.user file ,so it worked perfectly.



                                              This file just contain building device info and some more.






                                              share|improve this answer































                                                -1














                                                Deleting the .user file is exactly what fixed the problem for me. Lightning strike near the office shut my PC down and corrupted my .user file and project wouldn't load. I opened the file in Notepad++ and the "spaces" turned out to be [NULL] characters. Deleted the .user file and the file loaded!



                                                source https://forums.asp.net/t/1491251.aspx?Can+t+load+project+because+root+element+is+missing+






                                                share|improve this answer























                                                  Your Answer






                                                  StackExchange.ifUsing("editor", function () {
                                                  StackExchange.using("externalEditor", function () {
                                                  StackExchange.using("snippets", function () {
                                                  StackExchange.snippets.init();
                                                  });
                                                  });
                                                  }, "code-snippets");

                                                  StackExchange.ready(function() {
                                                  var channelOptions = {
                                                  tags: "".split(" "),
                                                  id: "1"
                                                  };
                                                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                                                  StackExchange.using("externalEditor", function() {
                                                  // Have to fire editor after snippets, if snippets enabled
                                                  if (StackExchange.settings.snippets.snippetsEnabled) {
                                                  StackExchange.using("snippets", function() {
                                                  createEditor();
                                                  });
                                                  }
                                                  else {
                                                  createEditor();
                                                  }
                                                  });

                                                  function createEditor() {
                                                  StackExchange.prepareEditor({
                                                  heartbeatType: 'answer',
                                                  autoActivateHeartbeat: false,
                                                  convertImagesToLinks: true,
                                                  noModals: true,
                                                  showLowRepImageUploadWarning: true,
                                                  reputationToPostImages: 10,
                                                  bindNavPrevention: true,
                                                  postfix: "",
                                                  imageUploader: {
                                                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                                                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                                                  allowUrls: true
                                                  },
                                                  onDemand: true,
                                                  discardSelector: ".discard-answer"
                                                  ,immediatelyShowMarkdownHelp:true
                                                  });


                                                  }
                                                  });














                                                  draft saved

                                                  draft discarded


















                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3772486%2fhow-to-fix-root-element-is-missing-when-doing-a-visual-studio-vs-build%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown

























                                                  27 Answers
                                                  27






                                                  active

                                                  oldest

                                                  votes








                                                  27 Answers
                                                  27






                                                  active

                                                  oldest

                                                  votes









                                                  active

                                                  oldest

                                                  votes






                                                  active

                                                  oldest

                                                  votes









                                                  29














                                                  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):



                                                  <?xml version="1.0"?> 
                                                  <rootElement>
                                                  ...
                                                  </rootElement>





                                                  share|improve this answer



















                                                  • 1





                                                    There are like thousands of files in my solution. Any special extensions to look at?

                                                    – Gerhard Weiss
                                                    Sep 22 '10 at 18:57






                                                  • 3





                                                    @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

                                                    – Oded
                                                    Sep 22 '10 at 19:09











                                                  • Worked briefly, but had to use Kahlil's answer.

                                                    – Eric Brown - Cal
                                                    Feb 14 '17 at 17:43
















                                                  29














                                                  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):



                                                  <?xml version="1.0"?> 
                                                  <rootElement>
                                                  ...
                                                  </rootElement>





                                                  share|improve this answer



















                                                  • 1





                                                    There are like thousands of files in my solution. Any special extensions to look at?

                                                    – Gerhard Weiss
                                                    Sep 22 '10 at 18:57






                                                  • 3





                                                    @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

                                                    – Oded
                                                    Sep 22 '10 at 19:09











                                                  • Worked briefly, but had to use Kahlil's answer.

                                                    – Eric Brown - Cal
                                                    Feb 14 '17 at 17:43














                                                  29












                                                  29








                                                  29







                                                  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):



                                                  <?xml version="1.0"?> 
                                                  <rootElement>
                                                  ...
                                                  </rootElement>





                                                  share|improve this answer













                                                  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):



                                                  <?xml version="1.0"?> 
                                                  <rootElement>
                                                  ...
                                                  </rootElement>






                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Sep 22 '10 at 18:36









                                                  OdedOded

                                                  411k72746915




                                                  411k72746915








                                                  • 1





                                                    There are like thousands of files in my solution. Any special extensions to look at?

                                                    – Gerhard Weiss
                                                    Sep 22 '10 at 18:57






                                                  • 3





                                                    @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

                                                    – Oded
                                                    Sep 22 '10 at 19:09











                                                  • Worked briefly, but had to use Kahlil's answer.

                                                    – Eric Brown - Cal
                                                    Feb 14 '17 at 17:43














                                                  • 1





                                                    There are like thousands of files in my solution. Any special extensions to look at?

                                                    – Gerhard Weiss
                                                    Sep 22 '10 at 18:57






                                                  • 3





                                                    @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

                                                    – Oded
                                                    Sep 22 '10 at 19:09











                                                  • Worked briefly, but had to use Kahlil's answer.

                                                    – Eric Brown - Cal
                                                    Feb 14 '17 at 17:43








                                                  1




                                                  1





                                                  There are like thousands of files in my solution. Any special extensions to look at?

                                                  – Gerhard Weiss
                                                  Sep 22 '10 at 18:57





                                                  There are like thousands of files in my solution. Any special extensions to look at?

                                                  – Gerhard Weiss
                                                  Sep 22 '10 at 18:57




                                                  3




                                                  3





                                                  @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

                                                  – Oded
                                                  Sep 22 '10 at 19:09





                                                  @Gerhard Weiss - .xml, .config, .xsd, .xsl would be a good start. If you have any XHTML files, they are also good candidates. I don't know anything about your project and what kind of files you have in it, so I can't really tell you. However, look at the error in the error window - it should tell you which file is causing the problem.

                                                  – Oded
                                                  Sep 22 '10 at 19:09













                                                  Worked briefly, but had to use Kahlil's answer.

                                                  – Eric Brown - Cal
                                                  Feb 14 '17 at 17:43





                                                  Worked briefly, but had to use Kahlil's answer.

                                                  – Eric Brown - Cal
                                                  Feb 14 '17 at 17:43













                                                  36














                                                  In my case it was the xxxxxxxxxxxx.vcxproj.user file that was causing the problem (it was blank) after a crash. I renamed it and the problem went away.






                                                  share|improve this answer



















                                                  • 13





                                                    Deleted my .user file and it worked again.. It was also blank after a SVN update

                                                    – TryingToImprove
                                                    Oct 30 '15 at 13:49






                                                  • 5





                                                    In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

                                                    – Garry
                                                    Jan 2 '16 at 13:41
















                                                  36














                                                  In my case it was the xxxxxxxxxxxx.vcxproj.user file that was causing the problem (it was blank) after a crash. I renamed it and the problem went away.






                                                  share|improve this answer



















                                                  • 13





                                                    Deleted my .user file and it worked again.. It was also blank after a SVN update

                                                    – TryingToImprove
                                                    Oct 30 '15 at 13:49






                                                  • 5





                                                    In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

                                                    – Garry
                                                    Jan 2 '16 at 13:41














                                                  36












                                                  36








                                                  36







                                                  In my case it was the xxxxxxxxxxxx.vcxproj.user file that was causing the problem (it was blank) after a crash. I renamed it and the problem went away.






                                                  share|improve this answer













                                                  In my case it was the xxxxxxxxxxxx.vcxproj.user file that was causing the problem (it was blank) after a crash. I renamed it and the problem went away.







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered May 18 '15 at 20:57









                                                  ElliotElliot

                                                  1,0501219




                                                  1,0501219








                                                  • 13





                                                    Deleted my .user file and it worked again.. It was also blank after a SVN update

                                                    – TryingToImprove
                                                    Oct 30 '15 at 13:49






                                                  • 5





                                                    In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

                                                    – Garry
                                                    Jan 2 '16 at 13:41














                                                  • 13





                                                    Deleted my .user file and it worked again.. It was also blank after a SVN update

                                                    – TryingToImprove
                                                    Oct 30 '15 at 13:49






                                                  • 5





                                                    In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

                                                    – Garry
                                                    Jan 2 '16 at 13:41








                                                  13




                                                  13





                                                  Deleted my .user file and it worked again.. It was also blank after a SVN update

                                                  – TryingToImprove
                                                  Oct 30 '15 at 13:49





                                                  Deleted my .user file and it worked again.. It was also blank after a SVN update

                                                  – TryingToImprove
                                                  Oct 30 '15 at 13:49




                                                  5




                                                  5





                                                  In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

                                                  – Garry
                                                  Jan 2 '16 at 13:41





                                                  In my case I was running VS 2015 - Community Edition when my machine crashed. When I tried to open my solution the project wouldn't load and was throwing a "root element is missing" error. Deleting the .user file for the projected allowed for the project to load again.

                                                  – Garry
                                                  Jan 2 '16 at 13:41











                                                  31














                                                  You will also get 'root element is missing' when the BOM strikes :). BOM = byte order mark. This is an extra character that gets added to the start of a file when it is saved with the wrong encoding.

                                                  This can happen sometimes in Visual Studio when working with XML files. You can either code something to remove it from all your files, or if you know which file it is you can force visual studio to save it with a specific encoding (utf-8 or ascii IIRC).



                                                  If you open the file in an editor other than VS (try notepad++), you will see two funny characters before the <? xml declaration.



                                                  To fix this in VS, open the file in VS and then depending on the version of VS




                                                  • File > Advanced Save Options > choose an appropriate encoding

                                                  • File > Save As > keep the filename, click the drop-down arrow on the right side of the save button to select an encoding






                                                  share|improve this answer


























                                                  • thank you you saved my day :)

                                                    – HB MAAM
                                                    Apr 17 '14 at 6:19
















                                                  31














                                                  You will also get 'root element is missing' when the BOM strikes :). BOM = byte order mark. This is an extra character that gets added to the start of a file when it is saved with the wrong encoding.

                                                  This can happen sometimes in Visual Studio when working with XML files. You can either code something to remove it from all your files, or if you know which file it is you can force visual studio to save it with a specific encoding (utf-8 or ascii IIRC).



                                                  If you open the file in an editor other than VS (try notepad++), you will see two funny characters before the <? xml declaration.



                                                  To fix this in VS, open the file in VS and then depending on the version of VS




                                                  • File > Advanced Save Options > choose an appropriate encoding

                                                  • File > Save As > keep the filename, click the drop-down arrow on the right side of the save button to select an encoding






                                                  share|improve this answer


























                                                  • thank you you saved my day :)

                                                    – HB MAAM
                                                    Apr 17 '14 at 6:19














                                                  31












                                                  31








                                                  31







                                                  You will also get 'root element is missing' when the BOM strikes :). BOM = byte order mark. This is an extra character that gets added to the start of a file when it is saved with the wrong encoding.

                                                  This can happen sometimes in Visual Studio when working with XML files. You can either code something to remove it from all your files, or if you know which file it is you can force visual studio to save it with a specific encoding (utf-8 or ascii IIRC).



                                                  If you open the file in an editor other than VS (try notepad++), you will see two funny characters before the <? xml declaration.



                                                  To fix this in VS, open the file in VS and then depending on the version of VS




                                                  • File > Advanced Save Options > choose an appropriate encoding

                                                  • File > Save As > keep the filename, click the drop-down arrow on the right side of the save button to select an encoding






                                                  share|improve this answer















                                                  You will also get 'root element is missing' when the BOM strikes :). BOM = byte order mark. This is an extra character that gets added to the start of a file when it is saved with the wrong encoding.

                                                  This can happen sometimes in Visual Studio when working with XML files. You can either code something to remove it from all your files, or if you know which file it is you can force visual studio to save it with a specific encoding (utf-8 or ascii IIRC).



                                                  If you open the file in an editor other than VS (try notepad++), you will see two funny characters before the <? xml declaration.



                                                  To fix this in VS, open the file in VS and then depending on the version of VS




                                                  • File > Advanced Save Options > choose an appropriate encoding

                                                  • File > Save As > keep the filename, click the drop-down arrow on the right side of the save button to select an encoding







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Mar 4 '16 at 9:37

























                                                  answered Sep 22 '10 at 19:07









                                                  stombeurstombeur

                                                  2,2741740




                                                  2,2741740













                                                  • thank you you saved my day :)

                                                    – HB MAAM
                                                    Apr 17 '14 at 6:19



















                                                  • thank you you saved my day :)

                                                    – HB MAAM
                                                    Apr 17 '14 at 6:19

















                                                  thank you you saved my day :)

                                                  – HB MAAM
                                                  Apr 17 '14 at 6:19





                                                  thank you you saved my day :)

                                                  – HB MAAM
                                                  Apr 17 '14 at 6:19











                                                  13














                                                  In my case.I was getting missing element error pointing to NuGet.Config file.
                                                  At that time it was looking some thing like this



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>


                                                  then I just added configuration tag that actually wraps entire xml. Now working fine for me



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <configuration>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>
                                                  </configuration>





                                                  share|improve this answer
























                                                  • Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

                                                    – cerberus
                                                    Apr 15 '18 at 20:47
















                                                  13














                                                  In my case.I was getting missing element error pointing to NuGet.Config file.
                                                  At that time it was looking some thing like this



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>


                                                  then I just added configuration tag that actually wraps entire xml. Now working fine for me



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <configuration>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>
                                                  </configuration>





                                                  share|improve this answer
























                                                  • Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

                                                    – cerberus
                                                    Apr 15 '18 at 20:47














                                                  13












                                                  13








                                                  13







                                                  In my case.I was getting missing element error pointing to NuGet.Config file.
                                                  At that time it was looking some thing like this



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>


                                                  then I just added configuration tag that actually wraps entire xml. Now working fine for me



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <configuration>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>
                                                  </configuration>





                                                  share|improve this answer













                                                  In my case.I was getting missing element error pointing to NuGet.Config file.
                                                  At that time it was looking some thing like this



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>


                                                  then I just added configuration tag that actually wraps entire xml. Now working fine for me



                                                  <?xml version="1.0" encoding="utf-8"?>
                                                  <configuration>
                                                  <settings>
                                                  <repositoryPath>Packages</repositoryPath>
                                                  </settings>
                                                  </configuration>






                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Jun 24 '16 at 18:21









                                                  Malik KhalilMalik Khalil

                                                  3,50712323




                                                  3,50712323













                                                  • Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

                                                    – cerberus
                                                    Apr 15 '18 at 20:47



















                                                  • Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

                                                    – cerberus
                                                    Apr 15 '18 at 20:47

















                                                  Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

                                                  – cerberus
                                                  Apr 15 '18 at 20:47





                                                  Awesome!!! Seems it depends on the version of visual studio. In VS 2012, the first step would work but in VS 2015, I don't think so.

                                                  – cerberus
                                                  Apr 15 '18 at 20:47











                                                  4














                                                  I got same error. showing error Microsoft.Data.Entity could not loaded root element missing. When i delete that file from C:WindowsMicrosoft.NETFrameworkv4.0.30319 and again open my solution my problem was solved. Everything woks fine






                                                  share|improve this answer




























                                                    4














                                                    I got same error. showing error Microsoft.Data.Entity could not loaded root element missing. When i delete that file from C:WindowsMicrosoft.NETFrameworkv4.0.30319 and again open my solution my problem was solved. Everything woks fine






                                                    share|improve this answer


























                                                      4












                                                      4








                                                      4







                                                      I got same error. showing error Microsoft.Data.Entity could not loaded root element missing. When i delete that file from C:WindowsMicrosoft.NETFrameworkv4.0.30319 and again open my solution my problem was solved. Everything woks fine






                                                      share|improve this answer













                                                      I got same error. showing error Microsoft.Data.Entity could not loaded root element missing. When i delete that file from C:WindowsMicrosoft.NETFrameworkv4.0.30319 and again open my solution my problem was solved. Everything woks fine







                                                      share|improve this answer












                                                      share|improve this answer



                                                      share|improve this answer










                                                      answered Jan 22 '15 at 9:55







                                                      user4481951






























                                                          4














                                                          In my case, when I opened the .csproj file, it was empty so I went to my previous commit in git and copied the contents of that file and pasted it my current .csproj file. After which I deleted the .csproj.user file, reloaded my project, and everything started working again.






                                                          share|improve this answer




























                                                            4














                                                            In my case, when I opened the .csproj file, it was empty so I went to my previous commit in git and copied the contents of that file and pasted it my current .csproj file. After which I deleted the .csproj.user file, reloaded my project, and everything started working again.






                                                            share|improve this answer


























                                                              4












                                                              4








                                                              4







                                                              In my case, when I opened the .csproj file, it was empty so I went to my previous commit in git and copied the contents of that file and pasted it my current .csproj file. After which I deleted the .csproj.user file, reloaded my project, and everything started working again.






                                                              share|improve this answer













                                                              In my case, when I opened the .csproj file, it was empty so I went to my previous commit in git and copied the contents of that file and pasted it my current .csproj file. After which I deleted the .csproj.user file, reloaded my project, and everything started working again.







                                                              share|improve this answer












                                                              share|improve this answer



                                                              share|improve this answer










                                                              answered Mar 2 '17 at 21:50









                                                              Alf MohAlf Moh

                                                              3,60522335




                                                              3,60522335























                                                                  3














                                                                  In my case, the file C:UsersxxxAppDataLocalPreEmptive SolutionsDotfuscator Professional Edition4.0dfusrprf.xml was full of NULL.



                                                                  I deleted it; it was recreated on the first launch of Dotfuscator, and after that, normality was restored.






                                                                  share|improve this answer
























                                                                  • Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                                                                    – Dimo
                                                                    Aug 15 '16 at 10:54
















                                                                  3














                                                                  In my case, the file C:UsersxxxAppDataLocalPreEmptive SolutionsDotfuscator Professional Edition4.0dfusrprf.xml was full of NULL.



                                                                  I deleted it; it was recreated on the first launch of Dotfuscator, and after that, normality was restored.






                                                                  share|improve this answer
























                                                                  • Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                                                                    – Dimo
                                                                    Aug 15 '16 at 10:54














                                                                  3












                                                                  3








                                                                  3







                                                                  In my case, the file C:UsersxxxAppDataLocalPreEmptive SolutionsDotfuscator Professional Edition4.0dfusrprf.xml was full of NULL.



                                                                  I deleted it; it was recreated on the first launch of Dotfuscator, and after that, normality was restored.






                                                                  share|improve this answer













                                                                  In my case, the file C:UsersxxxAppDataLocalPreEmptive SolutionsDotfuscator Professional Edition4.0dfusrprf.xml was full of NULL.



                                                                  I deleted it; it was recreated on the first launch of Dotfuscator, and after that, normality was restored.







                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Nov 27 '14 at 11:20









                                                                  pascalpascal

                                                                  2,7391328




                                                                  2,7391328













                                                                  • Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                                                                    – Dimo
                                                                    Aug 15 '16 at 10:54



















                                                                  • Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                                                                    – Dimo
                                                                    Aug 15 '16 at 10:54

















                                                                  Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                                                                  – Dimo
                                                                  Aug 15 '16 at 10:54





                                                                  Fixed by the same .. followed to file that not found deleted him and new file was created automatically .

                                                                  – Dimo
                                                                  Aug 15 '16 at 10:54











                                                                  3














                                                                  You can also search for the file. Navigate to your project directory with PowerShell and run Get-FileMissingRoot:



                                                                  function Get-FileMissingRoot {

                                                                  dir -recurse |
                                                                  where {
                                                                  ($_ -is [IO.FileInfo]) -and
                                                                  (@(".xml", ".config") -contains $_.extension)
                                                                  } |
                                                                  foreach {
                                                                  $xml = New-Object Xml.XmlDocument;
                                                                  $filename = $_.FullName
                                                                  try {
                                                                  $xml.Load($filename)
                                                                  }
                                                                  catch {
                                                                  write ("File: " + $filename)
                                                                  write ($_.Exception.Message)
                                                                  }
                                                                  }
                                                                  }





                                                                  share|improve this answer




























                                                                    3














                                                                    You can also search for the file. Navigate to your project directory with PowerShell and run Get-FileMissingRoot:



                                                                    function Get-FileMissingRoot {

                                                                    dir -recurse |
                                                                    where {
                                                                    ($_ -is [IO.FileInfo]) -and
                                                                    (@(".xml", ".config") -contains $_.extension)
                                                                    } |
                                                                    foreach {
                                                                    $xml = New-Object Xml.XmlDocument;
                                                                    $filename = $_.FullName
                                                                    try {
                                                                    $xml.Load($filename)
                                                                    }
                                                                    catch {
                                                                    write ("File: " + $filename)
                                                                    write ($_.Exception.Message)
                                                                    }
                                                                    }
                                                                    }





                                                                    share|improve this answer


























                                                                      3












                                                                      3








                                                                      3







                                                                      You can also search for the file. Navigate to your project directory with PowerShell and run Get-FileMissingRoot:



                                                                      function Get-FileMissingRoot {

                                                                      dir -recurse |
                                                                      where {
                                                                      ($_ -is [IO.FileInfo]) -and
                                                                      (@(".xml", ".config") -contains $_.extension)
                                                                      } |
                                                                      foreach {
                                                                      $xml = New-Object Xml.XmlDocument;
                                                                      $filename = $_.FullName
                                                                      try {
                                                                      $xml.Load($filename)
                                                                      }
                                                                      catch {
                                                                      write ("File: " + $filename)
                                                                      write ($_.Exception.Message)
                                                                      }
                                                                      }
                                                                      }





                                                                      share|improve this answer













                                                                      You can also search for the file. Navigate to your project directory with PowerShell and run Get-FileMissingRoot:



                                                                      function Get-FileMissingRoot {

                                                                      dir -recurse |
                                                                      where {
                                                                      ($_ -is [IO.FileInfo]) -and
                                                                      (@(".xml", ".config") -contains $_.extension)
                                                                      } |
                                                                      foreach {
                                                                      $xml = New-Object Xml.XmlDocument;
                                                                      $filename = $_.FullName
                                                                      try {
                                                                      $xml.Load($filename)
                                                                      }
                                                                      catch {
                                                                      write ("File: " + $filename)
                                                                      write ($_.Exception.Message)
                                                                      }
                                                                      }
                                                                      }






                                                                      share|improve this answer












                                                                      share|improve this answer



                                                                      share|improve this answer










                                                                      answered Aug 6 '15 at 19:06









                                                                      Sam PorchSam Porch

                                                                      45137




                                                                      45137























                                                                          2














                                                                          This error can sometimes occur when you edit some Project Toolchain settings Atmel Studio 6.1.2730 SP2.



                                                                          In my case I tried to edit Project Properties > Toolchain > Linker > General settings with 'All Configurations' selected in the Configuration. When I checked or unchecked a setting, a dialog with the error popped up. However, I found that I could make the same edits if I made them to only one build configuration at a time; i.e. with only 'Debug' or 'Release' selected instead of 'All Configurations'.



                                                                          Interestingly, I later was able to edit the same Linker settings even with 'All Configurations' selected. I don't know what changed in my project that made this possible.






                                                                          share|improve this answer
























                                                                          • Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                                                                            – hfrmobile
                                                                            Feb 19 '14 at 9:26


















                                                                          2














                                                                          This error can sometimes occur when you edit some Project Toolchain settings Atmel Studio 6.1.2730 SP2.



                                                                          In my case I tried to edit Project Properties > Toolchain > Linker > General settings with 'All Configurations' selected in the Configuration. When I checked or unchecked a setting, a dialog with the error popped up. However, I found that I could make the same edits if I made them to only one build configuration at a time; i.e. with only 'Debug' or 'Release' selected instead of 'All Configurations'.



                                                                          Interestingly, I later was able to edit the same Linker settings even with 'All Configurations' selected. I don't know what changed in my project that made this possible.






                                                                          share|improve this answer
























                                                                          • Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                                                                            – hfrmobile
                                                                            Feb 19 '14 at 9:26
















                                                                          2












                                                                          2








                                                                          2







                                                                          This error can sometimes occur when you edit some Project Toolchain settings Atmel Studio 6.1.2730 SP2.



                                                                          In my case I tried to edit Project Properties > Toolchain > Linker > General settings with 'All Configurations' selected in the Configuration. When I checked or unchecked a setting, a dialog with the error popped up. However, I found that I could make the same edits if I made them to only one build configuration at a time; i.e. with only 'Debug' or 'Release' selected instead of 'All Configurations'.



                                                                          Interestingly, I later was able to edit the same Linker settings even with 'All Configurations' selected. I don't know what changed in my project that made this possible.






                                                                          share|improve this answer













                                                                          This error can sometimes occur when you edit some Project Toolchain settings Atmel Studio 6.1.2730 SP2.



                                                                          In my case I tried to edit Project Properties > Toolchain > Linker > General settings with 'All Configurations' selected in the Configuration. When I checked or unchecked a setting, a dialog with the error popped up. However, I found that I could make the same edits if I made them to only one build configuration at a time; i.e. with only 'Debug' or 'Release' selected instead of 'All Configurations'.



                                                                          Interestingly, I later was able to edit the same Linker settings even with 'All Configurations' selected. I don't know what changed in my project that made this possible.







                                                                          share|improve this answer












                                                                          share|improve this answer



                                                                          share|improve this answer










                                                                          answered Dec 25 '13 at 11:52









                                                                          ptschnackptschnack

                                                                          7114




                                                                          7114













                                                                          • Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                                                                            – hfrmobile
                                                                            Feb 19 '14 at 9:26





















                                                                          • Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                                                                            – hfrmobile
                                                                            Feb 19 '14 at 9:26



















                                                                          Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                                                                          – hfrmobile
                                                                          Feb 19 '14 at 9:26







                                                                          Just encountered the same issue when adding a C #define for "All configurations". Seems that AtmelStudio is not able to to this for all configurations even when Debug/Release containing the same defines.

                                                                          – hfrmobile
                                                                          Feb 19 '14 at 9:26













                                                                          2














                                                                          I had Blue Screen while running Visual Studio 2013, when I Restart I intended to run again my project, but I had always this headius Error.
                                                                          anyway



                                                                          Deleting The Folders with the Temp info Fix this problem.
                                                                          in my case the Project was a Windows Server, and Basically it Creates a Folder with some Tem info.



                                                                          the folder was



                                                                          C:UsersUser_NAMEAppDataLocalNAme_OF_THeProject


                                                                          inside Exist a Folder with the Name of the Project+ some Generated GUI
                                                                          Service.ServerHostLoader_Url_u2jn0xkgjf1th0a3i2v03ft15vj4x52i



                                                                          this is the Folder I deleted and now I can run again the Project.






                                                                          share|improve this answer






























                                                                            2














                                                                            I had Blue Screen while running Visual Studio 2013, when I Restart I intended to run again my project, but I had always this headius Error.
                                                                            anyway



                                                                            Deleting The Folders with the Temp info Fix this problem.
                                                                            in my case the Project was a Windows Server, and Basically it Creates a Folder with some Tem info.



                                                                            the folder was



                                                                            C:UsersUser_NAMEAppDataLocalNAme_OF_THeProject


                                                                            inside Exist a Folder with the Name of the Project+ some Generated GUI
                                                                            Service.ServerHostLoader_Url_u2jn0xkgjf1th0a3i2v03ft15vj4x52i



                                                                            this is the Folder I deleted and now I can run again the Project.






                                                                            share|improve this answer




























                                                                              2












                                                                              2








                                                                              2







                                                                              I had Blue Screen while running Visual Studio 2013, when I Restart I intended to run again my project, but I had always this headius Error.
                                                                              anyway



                                                                              Deleting The Folders with the Temp info Fix this problem.
                                                                              in my case the Project was a Windows Server, and Basically it Creates a Folder with some Tem info.



                                                                              the folder was



                                                                              C:UsersUser_NAMEAppDataLocalNAme_OF_THeProject


                                                                              inside Exist a Folder with the Name of the Project+ some Generated GUI
                                                                              Service.ServerHostLoader_Url_u2jn0xkgjf1th0a3i2v03ft15vj4x52i



                                                                              this is the Folder I deleted and now I can run again the Project.






                                                                              share|improve this answer















                                                                              I had Blue Screen while running Visual Studio 2013, when I Restart I intended to run again my project, but I had always this headius Error.
                                                                              anyway



                                                                              Deleting The Folders with the Temp info Fix this problem.
                                                                              in my case the Project was a Windows Server, and Basically it Creates a Folder with some Tem info.



                                                                              the folder was



                                                                              C:UsersUser_NAMEAppDataLocalNAme_OF_THeProject


                                                                              inside Exist a Folder with the Name of the Project+ some Generated GUI
                                                                              Service.ServerHostLoader_Url_u2jn0xkgjf1th0a3i2v03ft15vj4x52i



                                                                              this is the Folder I deleted and now I can run again the Project.







                                                                              share|improve this answer














                                                                              share|improve this answer



                                                                              share|improve this answer








                                                                              edited Mar 2 '15 at 16:00









                                                                              Robert

                                                                              4,0621252106




                                                                              4,0621252106










                                                                              answered Mar 2 '15 at 15:35









                                                                              Ramomex1Ramomex1

                                                                              506




                                                                              506























                                                                                  1














                                                                                  In my case I upgraded to VS2017 and wanted to build all projects with MSBuild 4 with my build script (which had been using MSBuild 3.5 when we were using VS2015). That MSBuild upgrade appeared fine for the Windows desktop applications but the ones for Windows CE with compact framework would give me this confusing error. Reverting to MSBuild 3.5 for Windows CE projects fixed the issue for me.



                                                                                  I did have the BOM in .csproj files by the way and removed them for all projects in a solution that would not build but that did not help.






                                                                                  share|improve this answer




























                                                                                    1














                                                                                    In my case I upgraded to VS2017 and wanted to build all projects with MSBuild 4 with my build script (which had been using MSBuild 3.5 when we were using VS2015). That MSBuild upgrade appeared fine for the Windows desktop applications but the ones for Windows CE with compact framework would give me this confusing error. Reverting to MSBuild 3.5 for Windows CE projects fixed the issue for me.



                                                                                    I did have the BOM in .csproj files by the way and removed them for all projects in a solution that would not build but that did not help.






                                                                                    share|improve this answer


























                                                                                      1












                                                                                      1








                                                                                      1







                                                                                      In my case I upgraded to VS2017 and wanted to build all projects with MSBuild 4 with my build script (which had been using MSBuild 3.5 when we were using VS2015). That MSBuild upgrade appeared fine for the Windows desktop applications but the ones for Windows CE with compact framework would give me this confusing error. Reverting to MSBuild 3.5 for Windows CE projects fixed the issue for me.



                                                                                      I did have the BOM in .csproj files by the way and removed them for all projects in a solution that would not build but that did not help.






                                                                                      share|improve this answer













                                                                                      In my case I upgraded to VS2017 and wanted to build all projects with MSBuild 4 with my build script (which had been using MSBuild 3.5 when we were using VS2015). That MSBuild upgrade appeared fine for the Windows desktop applications but the ones for Windows CE with compact framework would give me this confusing error. Reverting to MSBuild 3.5 for Windows CE projects fixed the issue for me.



                                                                                      I did have the BOM in .csproj files by the way and removed them for all projects in a solution that would not build but that did not help.







                                                                                      share|improve this answer












                                                                                      share|improve this answer



                                                                                      share|improve this answer










                                                                                      answered Feb 23 '18 at 22:00









                                                                                      Martin MaatMartin Maat

                                                                                      550315




                                                                                      550315























                                                                                          1














                                                                                          This error is caused by corrupted proj file.
                                                                                          Visual Studio allway has backup project file at specific folder.
                                                                                          Pls browse to:
                                                                                          C:Users\DocumentsVisual Studio Backup Files
                                                                                          You can see 2 file same as:
                                                                                          Original-May-18-2018-1209PM..csproj
                                                                                          Recovered-May-18-2018-1209PM..csproj



                                                                                          You only need copy file: Original-May-18-2018-1209PM..csproj
                                                                                          And re-name as .csproj & overide at root project folder.
                                                                                          Trouble is solved!






                                                                                          share|improve this answer
























                                                                                          • this was it. txs!

                                                                                            – smoore4
                                                                                            Feb 8 at 16:30
















                                                                                          1














                                                                                          This error is caused by corrupted proj file.
                                                                                          Visual Studio allway has backup project file at specific folder.
                                                                                          Pls browse to:
                                                                                          C:Users\DocumentsVisual Studio Backup Files
                                                                                          You can see 2 file same as:
                                                                                          Original-May-18-2018-1209PM..csproj
                                                                                          Recovered-May-18-2018-1209PM..csproj



                                                                                          You only need copy file: Original-May-18-2018-1209PM..csproj
                                                                                          And re-name as .csproj & overide at root project folder.
                                                                                          Trouble is solved!






                                                                                          share|improve this answer
























                                                                                          • this was it. txs!

                                                                                            – smoore4
                                                                                            Feb 8 at 16:30














                                                                                          1












                                                                                          1








                                                                                          1







                                                                                          This error is caused by corrupted proj file.
                                                                                          Visual Studio allway has backup project file at specific folder.
                                                                                          Pls browse to:
                                                                                          C:Users\DocumentsVisual Studio Backup Files
                                                                                          You can see 2 file same as:
                                                                                          Original-May-18-2018-1209PM..csproj
                                                                                          Recovered-May-18-2018-1209PM..csproj



                                                                                          You only need copy file: Original-May-18-2018-1209PM..csproj
                                                                                          And re-name as .csproj & overide at root project folder.
                                                                                          Trouble is solved!






                                                                                          share|improve this answer













                                                                                          This error is caused by corrupted proj file.
                                                                                          Visual Studio allway has backup project file at specific folder.
                                                                                          Pls browse to:
                                                                                          C:Users\DocumentsVisual Studio Backup Files
                                                                                          You can see 2 file same as:
                                                                                          Original-May-18-2018-1209PM..csproj
                                                                                          Recovered-May-18-2018-1209PM..csproj



                                                                                          You only need copy file: Original-May-18-2018-1209PM..csproj
                                                                                          And re-name as .csproj & overide at root project folder.
                                                                                          Trouble is solved!







                                                                                          share|improve this answer












                                                                                          share|improve this answer



                                                                                          share|improve this answer










                                                                                          answered May 18 '18 at 10:43









                                                                                          user3037124user3037124

                                                                                          112




                                                                                          112













                                                                                          • this was it. txs!

                                                                                            – smoore4
                                                                                            Feb 8 at 16:30



















                                                                                          • this was it. txs!

                                                                                            – smoore4
                                                                                            Feb 8 at 16:30

















                                                                                          this was it. txs!

                                                                                          – smoore4
                                                                                          Feb 8 at 16:30





                                                                                          this was it. txs!

                                                                                          – smoore4
                                                                                          Feb 8 at 16:30











                                                                                          1














                                                                                          I had this issue running VS 2017, on build I was getting the error that the 'root element was missing'. What solved it for me was going to Tools > Nuget Package Manager > Package Manager Settings > General > Clear all Nuget Caches. After doing that I ran the build again and it was fixed.






                                                                                          share|improve this answer




























                                                                                            1














                                                                                            I had this issue running VS 2017, on build I was getting the error that the 'root element was missing'. What solved it for me was going to Tools > Nuget Package Manager > Package Manager Settings > General > Clear all Nuget Caches. After doing that I ran the build again and it was fixed.






                                                                                            share|improve this answer


























                                                                                              1












                                                                                              1








                                                                                              1







                                                                                              I had this issue running VS 2017, on build I was getting the error that the 'root element was missing'. What solved it for me was going to Tools > Nuget Package Manager > Package Manager Settings > General > Clear all Nuget Caches. After doing that I ran the build again and it was fixed.






                                                                                              share|improve this answer













                                                                                              I had this issue running VS 2017, on build I was getting the error that the 'root element was missing'. What solved it for me was going to Tools > Nuget Package Manager > Package Manager Settings > General > Clear all Nuget Caches. After doing that I ran the build again and it was fixed.







                                                                                              share|improve this answer












                                                                                              share|improve this answer



                                                                                              share|improve this answer










                                                                                              answered Nov 26 '18 at 15:51









                                                                                              Shawn HillShawn Hill

                                                                                              1112




                                                                                              1112























                                                                                                  1














                                                                                                  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.






                                                                                                  share|improve this answer




























                                                                                                    1














                                                                                                    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.






                                                                                                    share|improve this answer


























                                                                                                      1












                                                                                                      1








                                                                                                      1







                                                                                                      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.






                                                                                                      share|improve this answer













                                                                                                      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.







                                                                                                      share|improve this answer












                                                                                                      share|improve this answer



                                                                                                      share|improve this answer










                                                                                                      answered Jan 2 at 9:18









                                                                                                      TharinduTharindu

                                                                                                      915




                                                                                                      915























                                                                                                          0














                                                                                                          Ho i simply solved this issue by going to source control explorer and selected the issue project, right clicked and selected the option Get Specific Version under Advanced menu. And then selected Type as Latest Version and ticked following two check boxes and clicked Get button. Then i refreshed the solution and my project came back to live and problem gone. Please note that This may overwrite your local projects so your current changes may lose. So if you dont have any issues with your local copy then you can try this. Hope it helps






                                                                                                          share|improve this answer




























                                                                                                            0














                                                                                                            Ho i simply solved this issue by going to source control explorer and selected the issue project, right clicked and selected the option Get Specific Version under Advanced menu. And then selected Type as Latest Version and ticked following two check boxes and clicked Get button. Then i refreshed the solution and my project came back to live and problem gone. Please note that This may overwrite your local projects so your current changes may lose. So if you dont have any issues with your local copy then you can try this. Hope it helps






                                                                                                            share|improve this answer


























                                                                                                              0












                                                                                                              0








                                                                                                              0







                                                                                                              Ho i simply solved this issue by going to source control explorer and selected the issue project, right clicked and selected the option Get Specific Version under Advanced menu. And then selected Type as Latest Version and ticked following two check boxes and clicked Get button. Then i refreshed the solution and my project came back to live and problem gone. Please note that This may overwrite your local projects so your current changes may lose. So if you dont have any issues with your local copy then you can try this. Hope it helps






                                                                                                              share|improve this answer













                                                                                                              Ho i simply solved this issue by going to source control explorer and selected the issue project, right clicked and selected the option Get Specific Version under Advanced menu. And then selected Type as Latest Version and ticked following two check boxes and clicked Get button. Then i refreshed the solution and my project came back to live and problem gone. Please note that This may overwrite your local projects so your current changes may lose. So if you dont have any issues with your local copy then you can try this. Hope it helps







                                                                                                              share|improve this answer












                                                                                                              share|improve this answer



                                                                                                              share|improve this answer










                                                                                                              answered Jul 31 '15 at 11:32









                                                                                                              Nithin PaulNithin Paul

                                                                                                              1,03311937




                                                                                                              1,03311937























                                                                                                                  0














                                                                                                                  This was easy to fix than I thought. All I did was clear the website cache folder.



                                                                                                                  Delete everything from



                                                                                                                  DRIVE LETTER OF OS:UsersUSER NAMEAppDataLocalMicrosoftWebsiteCache



                                                                                                                  example



                                                                                                                  C:UsersJackAppDataLocalMicrosoftWebsiteCache



                                                                                                                  For more visual studio tips please visit My Blog






                                                                                                                  share|improve this answer




























                                                                                                                    0














                                                                                                                    This was easy to fix than I thought. All I did was clear the website cache folder.



                                                                                                                    Delete everything from



                                                                                                                    DRIVE LETTER OF OS:UsersUSER NAMEAppDataLocalMicrosoftWebsiteCache



                                                                                                                    example



                                                                                                                    C:UsersJackAppDataLocalMicrosoftWebsiteCache



                                                                                                                    For more visual studio tips please visit My Blog






                                                                                                                    share|improve this answer


























                                                                                                                      0












                                                                                                                      0








                                                                                                                      0







                                                                                                                      This was easy to fix than I thought. All I did was clear the website cache folder.



                                                                                                                      Delete everything from



                                                                                                                      DRIVE LETTER OF OS:UsersUSER NAMEAppDataLocalMicrosoftWebsiteCache



                                                                                                                      example



                                                                                                                      C:UsersJackAppDataLocalMicrosoftWebsiteCache



                                                                                                                      For more visual studio tips please visit My Blog






                                                                                                                      share|improve this answer













                                                                                                                      This was easy to fix than I thought. All I did was clear the website cache folder.



                                                                                                                      Delete everything from



                                                                                                                      DRIVE LETTER OF OS:UsersUSER NAMEAppDataLocalMicrosoftWebsiteCache



                                                                                                                      example



                                                                                                                      C:UsersJackAppDataLocalMicrosoftWebsiteCache



                                                                                                                      For more visual studio tips please visit My Blog







                                                                                                                      share|improve this answer












                                                                                                                      share|improve this answer



                                                                                                                      share|improve this answer










                                                                                                                      answered Apr 29 '16 at 3:16









                                                                                                                      Dulanjana WickramatantriDulanjana Wickramatantri

                                                                                                                      42437




                                                                                                                      42437























                                                                                                                          0














                                                                                                                          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.






                                                                                                                          share|improve this answer




























                                                                                                                            0














                                                                                                                            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.






                                                                                                                            share|improve this answer


























                                                                                                                              0












                                                                                                                              0








                                                                                                                              0







                                                                                                                              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.






                                                                                                                              share|improve this answer













                                                                                                                              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.







                                                                                                                              share|improve this answer












                                                                                                                              share|improve this answer



                                                                                                                              share|improve this answer










                                                                                                                              answered Aug 10 '16 at 17:24









                                                                                                                              JarretteJarrette

                                                                                                                              47611136




                                                                                                                              47611136























                                                                                                                                  0














                                                                                                                                  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:



                                                                                                                                  rep
                                                                                                                                  repmyreport.rdlc
                                                                                                                                  repApp_LocalResourcesmyreport.rdlc.resx





                                                                                                                                  share|improve this answer




























                                                                                                                                    0














                                                                                                                                    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:



                                                                                                                                    rep
                                                                                                                                    repmyreport.rdlc
                                                                                                                                    repApp_LocalResourcesmyreport.rdlc.resx





                                                                                                                                    share|improve this answer


























                                                                                                                                      0












                                                                                                                                      0








                                                                                                                                      0







                                                                                                                                      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:



                                                                                                                                      rep
                                                                                                                                      repmyreport.rdlc
                                                                                                                                      repApp_LocalResourcesmyreport.rdlc.resx





                                                                                                                                      share|improve this answer













                                                                                                                                      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:



                                                                                                                                      rep
                                                                                                                                      repmyreport.rdlc
                                                                                                                                      repApp_LocalResourcesmyreport.rdlc.resx






                                                                                                                                      share|improve this answer












                                                                                                                                      share|improve this answer



                                                                                                                                      share|improve this answer










                                                                                                                                      answered Feb 7 '17 at 21:15









                                                                                                                                      WilsonWilson

                                                                                                                                      39266




                                                                                                                                      39266























                                                                                                                                          0














                                                                                                                                          I had a few massive VS2015 Community crashes.




                                                                                                                                          Delete all the .csproj.user files




                                                                                                                                          which were full of null characters, and also these




                                                                                                                                          C:UsersUserNameAppDataLocalTemp



                                                                                                                                          .NETFramework,Version=v4.0.AssemblyAttributes.cs
                                                                                                                                          .NETFramework,Version=v4.5.AssemblyAttributes.cs
                                                                                                                                          .NETFramework,Version=v4.5.2.AssemblyAttributes.cs







                                                                                                                                          share|improve this answer




























                                                                                                                                            0














                                                                                                                                            I had a few massive VS2015 Community crashes.




                                                                                                                                            Delete all the .csproj.user files




                                                                                                                                            which were full of null characters, and also these




                                                                                                                                            C:UsersUserNameAppDataLocalTemp



                                                                                                                                            .NETFramework,Version=v4.0.AssemblyAttributes.cs
                                                                                                                                            .NETFramework,Version=v4.5.AssemblyAttributes.cs
                                                                                                                                            .NETFramework,Version=v4.5.2.AssemblyAttributes.cs







                                                                                                                                            share|improve this answer


























                                                                                                                                              0












                                                                                                                                              0








                                                                                                                                              0







                                                                                                                                              I had a few massive VS2015 Community crashes.




                                                                                                                                              Delete all the .csproj.user files




                                                                                                                                              which were full of null characters, and also these




                                                                                                                                              C:UsersUserNameAppDataLocalTemp



                                                                                                                                              .NETFramework,Version=v4.0.AssemblyAttributes.cs
                                                                                                                                              .NETFramework,Version=v4.5.AssemblyAttributes.cs
                                                                                                                                              .NETFramework,Version=v4.5.2.AssemblyAttributes.cs







                                                                                                                                              share|improve this answer













                                                                                                                                              I had a few massive VS2015 Community crashes.




                                                                                                                                              Delete all the .csproj.user files




                                                                                                                                              which were full of null characters, and also these




                                                                                                                                              C:UsersUserNameAppDataLocalTemp



                                                                                                                                              .NETFramework,Version=v4.0.AssemblyAttributes.cs
                                                                                                                                              .NETFramework,Version=v4.5.AssemblyAttributes.cs
                                                                                                                                              .NETFramework,Version=v4.5.2.AssemblyAttributes.cs








                                                                                                                                              share|improve this answer












                                                                                                                                              share|improve this answer



                                                                                                                                              share|improve this answer










                                                                                                                                              answered Feb 9 '17 at 13:03









                                                                                                                                              CRiceCRice

                                                                                                                                              8,68064676




                                                                                                                                              8,68064676























                                                                                                                                                  0














                                                                                                                                                  In my case I received a message like this:
                                                                                                                                                  See this picture



                                                                                                                                                  I just commented the snipped code below in the project file (.csproj) and the problem was fixed.



                                                                                                                                                  <Import Project="$(MSBuildBinPath)Microsoft.CSharp.targets" />





                                                                                                                                                  share|improve this answer






























                                                                                                                                                    0














                                                                                                                                                    In my case I received a message like this:
                                                                                                                                                    See this picture



                                                                                                                                                    I just commented the snipped code below in the project file (.csproj) and the problem was fixed.



                                                                                                                                                    <Import Project="$(MSBuildBinPath)Microsoft.CSharp.targets" />





                                                                                                                                                    share|improve this answer




























                                                                                                                                                      0












                                                                                                                                                      0








                                                                                                                                                      0







                                                                                                                                                      In my case I received a message like this:
                                                                                                                                                      See this picture



                                                                                                                                                      I just commented the snipped code below in the project file (.csproj) and the problem was fixed.



                                                                                                                                                      <Import Project="$(MSBuildBinPath)Microsoft.CSharp.targets" />





                                                                                                                                                      share|improve this answer















                                                                                                                                                      In my case I received a message like this:
                                                                                                                                                      See this picture



                                                                                                                                                      I just commented the snipped code below in the project file (.csproj) and the problem was fixed.



                                                                                                                                                      <Import Project="$(MSBuildBinPath)Microsoft.CSharp.targets" />






                                                                                                                                                      share|improve this answer














                                                                                                                                                      share|improve this answer



                                                                                                                                                      share|improve this answer








                                                                                                                                                      edited Mar 3 '17 at 20:06









                                                                                                                                                      Tunaki

                                                                                                                                                      90.1k22196271




                                                                                                                                                      90.1k22196271










                                                                                                                                                      answered Mar 2 '17 at 18:03









                                                                                                                                                      Eduardo SobrinhoEduardo Sobrinho

                                                                                                                                                      194




                                                                                                                                                      194























                                                                                                                                                          0














                                                                                                                                                          In my case xxxx.pubxml.user was not loaded when tried to publish the application. I deleted the file and restart the Visual studio then created a new profile to publish it, problem is solved and published successfully.






                                                                                                                                                          share|improve this answer




























                                                                                                                                                            0














                                                                                                                                                            In my case xxxx.pubxml.user was not loaded when tried to publish the application. I deleted the file and restart the Visual studio then created a new profile to publish it, problem is solved and published successfully.






                                                                                                                                                            share|improve this answer


























                                                                                                                                                              0












                                                                                                                                                              0








                                                                                                                                                              0







                                                                                                                                                              In my case xxxx.pubxml.user was not loaded when tried to publish the application. I deleted the file and restart the Visual studio then created a new profile to publish it, problem is solved and published successfully.






                                                                                                                                                              share|improve this answer













                                                                                                                                                              In my case xxxx.pubxml.user was not loaded when tried to publish the application. I deleted the file and restart the Visual studio then created a new profile to publish it, problem is solved and published successfully.







                                                                                                                                                              share|improve this answer












                                                                                                                                                              share|improve this answer



                                                                                                                                                              share|improve this answer










                                                                                                                                                              answered Jun 17 '17 at 6:10









                                                                                                                                                              Muhammad MasudMuhammad Masud

                                                                                                                                                              195




                                                                                                                                                              195























                                                                                                                                                                  0














                                                                                                                                                                  Hey, I have the same issue on Mac working on a Cocoa C# solution.
                                                                                                                                                                  (But I solved it !)



                                                                                                                                                                  It always say that the root element is missing so it cannot load my C# project file.



                                                                                                                                                                  I have the 2017 Visual Studio Mac Community Edition.
                                                                                                                                                                  I finally managed to find a solution after several hours (painful!).



                                                                                                                                                                  My solution is because the frameworks related to the Visual Studio are old or broken.
                                                                                                                                                                  I found this because I tried to create a new Mac solution by Cocoa and it said "failed to save the solution". Then, I tried to create an Android Solution and it is working fine.
                                                                                                                                                                  Go to your "Finder" and "Go" -> "Go to a Folder" then go to the "Library/Frameworks". I have deleted mono.framework and frameworks related to Xamarin because I believe these Xamarin frameworks are broken.



                                                                                                                                                                  Then, uninstalled the Visual Studio and reinstalled it.
                                                                                                                                                                  Now everything works fine!






                                                                                                                                                                  share|improve this answer




























                                                                                                                                                                    0














                                                                                                                                                                    Hey, I have the same issue on Mac working on a Cocoa C# solution.
                                                                                                                                                                    (But I solved it !)



                                                                                                                                                                    It always say that the root element is missing so it cannot load my C# project file.



                                                                                                                                                                    I have the 2017 Visual Studio Mac Community Edition.
                                                                                                                                                                    I finally managed to find a solution after several hours (painful!).



                                                                                                                                                                    My solution is because the frameworks related to the Visual Studio are old or broken.
                                                                                                                                                                    I found this because I tried to create a new Mac solution by Cocoa and it said "failed to save the solution". Then, I tried to create an Android Solution and it is working fine.
                                                                                                                                                                    Go to your "Finder" and "Go" -> "Go to a Folder" then go to the "Library/Frameworks". I have deleted mono.framework and frameworks related to Xamarin because I believe these Xamarin frameworks are broken.



                                                                                                                                                                    Then, uninstalled the Visual Studio and reinstalled it.
                                                                                                                                                                    Now everything works fine!






                                                                                                                                                                    share|improve this answer


























                                                                                                                                                                      0












                                                                                                                                                                      0








                                                                                                                                                                      0







                                                                                                                                                                      Hey, I have the same issue on Mac working on a Cocoa C# solution.
                                                                                                                                                                      (But I solved it !)



                                                                                                                                                                      It always say that the root element is missing so it cannot load my C# project file.



                                                                                                                                                                      I have the 2017 Visual Studio Mac Community Edition.
                                                                                                                                                                      I finally managed to find a solution after several hours (painful!).



                                                                                                                                                                      My solution is because the frameworks related to the Visual Studio are old or broken.
                                                                                                                                                                      I found this because I tried to create a new Mac solution by Cocoa and it said "failed to save the solution". Then, I tried to create an Android Solution and it is working fine.
                                                                                                                                                                      Go to your "Finder" and "Go" -> "Go to a Folder" then go to the "Library/Frameworks". I have deleted mono.framework and frameworks related to Xamarin because I believe these Xamarin frameworks are broken.



                                                                                                                                                                      Then, uninstalled the Visual Studio and reinstalled it.
                                                                                                                                                                      Now everything works fine!






                                                                                                                                                                      share|improve this answer













                                                                                                                                                                      Hey, I have the same issue on Mac working on a Cocoa C# solution.
                                                                                                                                                                      (But I solved it !)



                                                                                                                                                                      It always say that the root element is missing so it cannot load my C# project file.



                                                                                                                                                                      I have the 2017 Visual Studio Mac Community Edition.
                                                                                                                                                                      I finally managed to find a solution after several hours (painful!).



                                                                                                                                                                      My solution is because the frameworks related to the Visual Studio are old or broken.
                                                                                                                                                                      I found this because I tried to create a new Mac solution by Cocoa and it said "failed to save the solution". Then, I tried to create an Android Solution and it is working fine.
                                                                                                                                                                      Go to your "Finder" and "Go" -> "Go to a Folder" then go to the "Library/Frameworks". I have deleted mono.framework and frameworks related to Xamarin because I believe these Xamarin frameworks are broken.



                                                                                                                                                                      Then, uninstalled the Visual Studio and reinstalled it.
                                                                                                                                                                      Now everything works fine!







                                                                                                                                                                      share|improve this answer












                                                                                                                                                                      share|improve this answer



                                                                                                                                                                      share|improve this answer










                                                                                                                                                                      answered Aug 7 '17 at 21:14









                                                                                                                                                                      Can GaoCan Gao

                                                                                                                                                                      112




                                                                                                                                                                      112























                                                                                                                                                                          0














                                                                                                                                                                          In my case, I got this error because of an empty packages.config file.
                                                                                                                                                                          This caused the NUGET package manager to fail and show the error Root element is missing.
                                                                                                                                                                          The resolution was to copy over elements from another non-empty file and then change it according to the needs.



                                                                                                                                                                          Example (packages.config):



                                                                                                                                                                          <?xml version="1.0" encoding="utf-8"?>
                                                                                                                                                                          <packages>
                                                                                                                                                                          <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451"/>
                                                                                                                                                                          <package id="Newtonsoft.Json" version="5.0.4" targetFramework="net451"/>
                                                                                                                                                                          </packages>





                                                                                                                                                                          share|improve this answer




























                                                                                                                                                                            0














                                                                                                                                                                            In my case, I got this error because of an empty packages.config file.
                                                                                                                                                                            This caused the NUGET package manager to fail and show the error Root element is missing.
                                                                                                                                                                            The resolution was to copy over elements from another non-empty file and then change it according to the needs.



                                                                                                                                                                            Example (packages.config):



                                                                                                                                                                            <?xml version="1.0" encoding="utf-8"?>
                                                                                                                                                                            <packages>
                                                                                                                                                                            <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451"/>
                                                                                                                                                                            <package id="Newtonsoft.Json" version="5.0.4" targetFramework="net451"/>
                                                                                                                                                                            </packages>





                                                                                                                                                                            share|improve this answer


























                                                                                                                                                                              0












                                                                                                                                                                              0








                                                                                                                                                                              0







                                                                                                                                                                              In my case, I got this error because of an empty packages.config file.
                                                                                                                                                                              This caused the NUGET package manager to fail and show the error Root element is missing.
                                                                                                                                                                              The resolution was to copy over elements from another non-empty file and then change it according to the needs.



                                                                                                                                                                              Example (packages.config):



                                                                                                                                                                              <?xml version="1.0" encoding="utf-8"?>
                                                                                                                                                                              <packages>
                                                                                                                                                                              <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451"/>
                                                                                                                                                                              <package id="Newtonsoft.Json" version="5.0.4" targetFramework="net451"/>
                                                                                                                                                                              </packages>





                                                                                                                                                                              share|improve this answer













                                                                                                                                                                              In my case, I got this error because of an empty packages.config file.
                                                                                                                                                                              This caused the NUGET package manager to fail and show the error Root element is missing.
                                                                                                                                                                              The resolution was to copy over elements from another non-empty file and then change it according to the needs.



                                                                                                                                                                              Example (packages.config):



                                                                                                                                                                              <?xml version="1.0" encoding="utf-8"?>
                                                                                                                                                                              <packages>
                                                                                                                                                                              <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451"/>
                                                                                                                                                                              <package id="Newtonsoft.Json" version="5.0.4" targetFramework="net451"/>
                                                                                                                                                                              </packages>






                                                                                                                                                                              share|improve this answer












                                                                                                                                                                              share|improve this answer



                                                                                                                                                                              share|improve this answer










                                                                                                                                                                              answered Mar 1 '18 at 14:38









                                                                                                                                                                              MattMatt

                                                                                                                                                                              15.4k766110




                                                                                                                                                                              15.4k766110























                                                                                                                                                                                  0














                                                                                                                                                                                  In my case, i was using vs 2010 with crystal report. Innerexception revealed root element is missing error. Go to directory like C:UserssamAppDataLocaldssmsdssms.vshost.exe_Url_uy5is55gioxym5avqidulehrfjbdsn131.0.0.0 which is given in the innermessage and make sure user.config is proper XML (mine was blank for some reason).






                                                                                                                                                                                  share|improve this answer




























                                                                                                                                                                                    0














                                                                                                                                                                                    In my case, i was using vs 2010 with crystal report. Innerexception revealed root element is missing error. Go to directory like C:UserssamAppDataLocaldssmsdssms.vshost.exe_Url_uy5is55gioxym5avqidulehrfjbdsn131.0.0.0 which is given in the innermessage and make sure user.config is proper XML (mine was blank for some reason).






                                                                                                                                                                                    share|improve this answer


























                                                                                                                                                                                      0












                                                                                                                                                                                      0








                                                                                                                                                                                      0







                                                                                                                                                                                      In my case, i was using vs 2010 with crystal report. Innerexception revealed root element is missing error. Go to directory like C:UserssamAppDataLocaldssmsdssms.vshost.exe_Url_uy5is55gioxym5avqidulehrfjbdsn131.0.0.0 which is given in the innermessage and make sure user.config is proper XML (mine was blank for some reason).






                                                                                                                                                                                      share|improve this answer













                                                                                                                                                                                      In my case, i was using vs 2010 with crystal report. Innerexception revealed root element is missing error. Go to directory like C:UserssamAppDataLocaldssmsdssms.vshost.exe_Url_uy5is55gioxym5avqidulehrfjbdsn131.0.0.0 which is given in the innermessage and make sure user.config is proper XML (mine was blank for some reason).







                                                                                                                                                                                      share|improve this answer












                                                                                                                                                                                      share|improve this answer



                                                                                                                                                                                      share|improve this answer










                                                                                                                                                                                      answered Mar 29 '18 at 10:40









                                                                                                                                                                                      Nie SelamNie Selam

                                                                                                                                                                                      467416




                                                                                                                                                                                      467416























                                                                                                                                                                                          0














                                                                                                                                                                                          In xamarin form project. I deleted



                                                                                                                                                                                          .VS Project folder.
                                                                                                                                                                                          ProjectName.Android.csProj.User
                                                                                                                                                                                          ProjectName.Android.csProj.bak





                                                                                                                                                                                          share|improve this answer




























                                                                                                                                                                                            0














                                                                                                                                                                                            In xamarin form project. I deleted



                                                                                                                                                                                            .VS Project folder.
                                                                                                                                                                                            ProjectName.Android.csProj.User
                                                                                                                                                                                            ProjectName.Android.csProj.bak





                                                                                                                                                                                            share|improve this answer


























                                                                                                                                                                                              0












                                                                                                                                                                                              0








                                                                                                                                                                                              0







                                                                                                                                                                                              In xamarin form project. I deleted



                                                                                                                                                                                              .VS Project folder.
                                                                                                                                                                                              ProjectName.Android.csProj.User
                                                                                                                                                                                              ProjectName.Android.csProj.bak





                                                                                                                                                                                              share|improve this answer













                                                                                                                                                                                              In xamarin form project. I deleted



                                                                                                                                                                                              .VS Project folder.
                                                                                                                                                                                              ProjectName.Android.csProj.User
                                                                                                                                                                                              ProjectName.Android.csProj.bak






                                                                                                                                                                                              share|improve this answer












                                                                                                                                                                                              share|improve this answer



                                                                                                                                                                                              share|improve this answer










                                                                                                                                                                                              answered Jan 12 at 8:23









                                                                                                                                                                                              A.GoutamA.Goutam

                                                                                                                                                                                              1,75442651




                                                                                                                                                                                              1,75442651























                                                                                                                                                                                                  0














                                                                                                                                                                                                  In my case the problem occurred due to closing my PC while visual studio were remain open, so in result csproj.user file saved empty. Thankfully i have already backup, so i just copied all xml from csproj.user and paste in my affected project csproj.user file ,so it worked perfectly.



                                                                                                                                                                                                  This file just contain building device info and some more.






                                                                                                                                                                                                  share|improve this answer




























                                                                                                                                                                                                    0














                                                                                                                                                                                                    In my case the problem occurred due to closing my PC while visual studio were remain open, so in result csproj.user file saved empty. Thankfully i have already backup, so i just copied all xml from csproj.user and paste in my affected project csproj.user file ,so it worked perfectly.



                                                                                                                                                                                                    This file just contain building device info and some more.






                                                                                                                                                                                                    share|improve this answer


























                                                                                                                                                                                                      0












                                                                                                                                                                                                      0








                                                                                                                                                                                                      0







                                                                                                                                                                                                      In my case the problem occurred due to closing my PC while visual studio were remain open, so in result csproj.user file saved empty. Thankfully i have already backup, so i just copied all xml from csproj.user and paste in my affected project csproj.user file ,so it worked perfectly.



                                                                                                                                                                                                      This file just contain building device info and some more.






                                                                                                                                                                                                      share|improve this answer













                                                                                                                                                                                                      In my case the problem occurred due to closing my PC while visual studio were remain open, so in result csproj.user file saved empty. Thankfully i have already backup, so i just copied all xml from csproj.user and paste in my affected project csproj.user file ,so it worked perfectly.



                                                                                                                                                                                                      This file just contain building device info and some more.







                                                                                                                                                                                                      share|improve this answer












                                                                                                                                                                                                      share|improve this answer



                                                                                                                                                                                                      share|improve this answer










                                                                                                                                                                                                      answered Jan 15 at 6:35









                                                                                                                                                                                                      Mir KaramMir Karam

                                                                                                                                                                                                      715




                                                                                                                                                                                                      715























                                                                                                                                                                                                          -1














                                                                                                                                                                                                          Deleting the .user file is exactly what fixed the problem for me. Lightning strike near the office shut my PC down and corrupted my .user file and project wouldn't load. I opened the file in Notepad++ and the "spaces" turned out to be [NULL] characters. Deleted the .user file and the file loaded!



                                                                                                                                                                                                          source https://forums.asp.net/t/1491251.aspx?Can+t+load+project+because+root+element+is+missing+






                                                                                                                                                                                                          share|improve this answer




























                                                                                                                                                                                                            -1














                                                                                                                                                                                                            Deleting the .user file is exactly what fixed the problem for me. Lightning strike near the office shut my PC down and corrupted my .user file and project wouldn't load. I opened the file in Notepad++ and the "spaces" turned out to be [NULL] characters. Deleted the .user file and the file loaded!



                                                                                                                                                                                                            source https://forums.asp.net/t/1491251.aspx?Can+t+load+project+because+root+element+is+missing+






                                                                                                                                                                                                            share|improve this answer


























                                                                                                                                                                                                              -1












                                                                                                                                                                                                              -1








                                                                                                                                                                                                              -1







                                                                                                                                                                                                              Deleting the .user file is exactly what fixed the problem for me. Lightning strike near the office shut my PC down and corrupted my .user file and project wouldn't load. I opened the file in Notepad++ and the "spaces" turned out to be [NULL] characters. Deleted the .user file and the file loaded!



                                                                                                                                                                                                              source https://forums.asp.net/t/1491251.aspx?Can+t+load+project+because+root+element+is+missing+






                                                                                                                                                                                                              share|improve this answer













                                                                                                                                                                                                              Deleting the .user file is exactly what fixed the problem for me. Lightning strike near the office shut my PC down and corrupted my .user file and project wouldn't load. I opened the file in Notepad++ and the "spaces" turned out to be [NULL] characters. Deleted the .user file and the file loaded!



                                                                                                                                                                                                              source https://forums.asp.net/t/1491251.aspx?Can+t+load+project+because+root+element+is+missing+







                                                                                                                                                                                                              share|improve this answer












                                                                                                                                                                                                              share|improve this answer



                                                                                                                                                                                                              share|improve this answer










                                                                                                                                                                                                              answered Jan 2 at 7:33









                                                                                                                                                                                                              Shailendra bindShailendra bind

                                                                                                                                                                                                              11




                                                                                                                                                                                                              11






























                                                                                                                                                                                                                  draft saved

                                                                                                                                                                                                                  draft discarded




















































                                                                                                                                                                                                                  Thanks for contributing an answer to Stack Overflow!


                                                                                                                                                                                                                  • Please be sure to answer the question. Provide details and share your research!

                                                                                                                                                                                                                  But avoid



                                                                                                                                                                                                                  • Asking for help, clarification, or responding to other answers.

                                                                                                                                                                                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                                                                                                                                                                                  To learn more, see our tips on writing great answers.




                                                                                                                                                                                                                  draft saved


                                                                                                                                                                                                                  draft discarded














                                                                                                                                                                                                                  StackExchange.ready(
                                                                                                                                                                                                                  function () {
                                                                                                                                                                                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3772486%2fhow-to-fix-root-element-is-missing-when-doing-a-visual-studio-vs-build%23new-answer', 'question_page');
                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  );

                                                                                                                                                                                                                  Post as a guest















                                                                                                                                                                                                                  Required, but never shown





















































                                                                                                                                                                                                                  Required, but never shown














                                                                                                                                                                                                                  Required, but never shown












                                                                                                                                                                                                                  Required, but never shown







                                                                                                                                                                                                                  Required, but never shown

































                                                                                                                                                                                                                  Required, but never shown














                                                                                                                                                                                                                  Required, but never shown












                                                                                                                                                                                                                  Required, but never shown







                                                                                                                                                                                                                  Required, but never shown







                                                                                                                                                                                                                  Popular posts from this blog

                                                                                                                                                                                                                  Contact image not getting when fetch all contact list from iPhone by CNContact

                                                                                                                                                                                                                  count number of partitions of a set with n elements into k subsets

                                                                                                                                                                                                                  A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks