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

前端 未结 30 2423
北荒
北荒 2020-12-01 09:13

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 thi

相关标签:
30条回答
  • 2020-12-01 09:26

    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.

    0 讨论(0)
  • 2020-12-01 09:27

    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.

    0 讨论(0)
  • 2020-12-01 09:27

    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

    0 讨论(0)
  • 2020-12-01 09:30

    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.

    0 讨论(0)
  • 2020-12-01 09:31

    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>
    
    0 讨论(0)
  • 2020-12-01 09:31

    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.

    0 讨论(0)
提交回复
热议问题