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

前端 未结 30 2425
北荒
北荒 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:20

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

    In xamarin form project. I deleted

    .VS Project folder.
    ProjectName.Android.csProj.User
    ProjectName.Android.csProj.bak
    
    0 讨论(0)
  • 2020-12-01 09:23

    No one of these solutions fixed my problem.

    In my case, I finished my work and I shut down my computer. The day after I wasn't able to compile my project. I tried some of these solutions and I realized all my projects weren't work.

    To Fix it, I reinstall .net core Framework.

    Visual Studio 2017

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

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

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

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

    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:\Users\User_NAME\AppData\Local\NAme_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.

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