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

前端 未结 30 2529
北荒
北荒 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: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)
                }
            }
    }
    

提交回复
热议问题