title: ASP.NET Server.Mappath problem from inner folders
body: <p>I have an ASP.NET application where in my APP_Code folder I have a class. In that I have the following code to read the content of an XML file which is in my root folder:</p>
  <pre><code>XmlDocument xmlSiteConfig = new XmlDocument();
  xmlSiteConfig.Load(System.Web.HttpContext.Current.Server.MapPath(&quot;../myConfig.xml&quot;));
  </code></pre>
  <p>My Root folder is having several folders with nested inner folders for some. From the first level of folders when I call the piece of code in the Appcode class, I am able to load the XML file correctly since the path is correct. Now if I call the same piece of code from an inner folder, I am getting an error. If I change the code to the below it will work fine</p>
  <pre><code>xmlSiteConfig.Load(System.Web.HttpContext.Current.Server.MapPath(&quot;../../myConfig.xml&quot;));
  </code></pre>
  <p>How can I solve this? I don't want to change the file path for various calls to this code.With what piece of code I can solve the issue so that the program will load the XML file irrespective of the calling position.</p>