Server Error in '/' Application.

Root element is missing.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: Root element is missing.

Source Error:


Line 10:         {
Line 11:             string FileId = Request.Params["fileid"];
Line 12:             XDocument xdoc = XDocument.Load(Server.MapPath("downloads.config"));
Line 13:             XElement selectedNode = xdoc.Elements("Downloads").Elements("Download").FirstOrDefault(p => p.Attribute("ID").Value == FileId);
Line 14:             string filePath = selectedNode.Attribute("Path").Value;

Source File: c:\sites\thousandtyone\contentdownloadcenter\Downloader.aspx.cs    Line: 12

Stack Trace:


[XmlException: Root element is missing.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +89
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +6495298
   System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +60
   System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) +104
   Downloader.Page_Load(Object sender, EventArgs e) in c:\sites\thousandtyone\contentdownloadcenter\Downloader.aspx.cs:12
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0