How to reference xml file locally?
<p>I have a solution with an ASP.NET project and a Class library project where the ASP.NET project depends on the Class library as a data access layer.</p>

<p>In my Class library project, I have SiteSetting.xml and c# code that's requesting the xml file as follows.</p>

<p>C# Code:</p>

<pre><code>
DataSet ds = new DataSet();
ds.ReadXml("SiteSetting.xml");
</code></pre>

<p>When i launch my asp.net application and view the page that calls on the c# code above, I get an error saying "Could not find file 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\SiteSetting.xml'."</p>

<p>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ is obviously not where my c# code resides. My source code is in c:\Projects.. but where is compiled binaries of my ASP.NET and class library projects are executed? Better question is, how do i correctly reference SiteSetting.xml using relative paths in the context of ds.ReadXml()? </p>

<p>I want to use relative paths so that where my binaries are being executed will not an issue when finding SiteSetting.xml</p>

<p><strong>UPDATE</strong>
Thanks for your input guys. Server.MapPath() is close but no cigar. Server.MapPath gives back a relative path in my ASP.NET project and not my c#, which is where my SiteSettings.xml resides.</p>

<p>So for example i have project called StackOverflow that has a C# project called "StackOverflow.Data" and an ASP.NET web project called "www" then i would have the following folders.</p>

<p>c:\Projects\StackOverflow
c:\Projects\StackOverflow\StackOverFlow.Data  &lt;- Class Library project as my data access Layer
c:\Projects\StackOverflow\www &lt;- ASP.NET project that calls on StackOverflow.Data classes and methods</p>

<p>Server.MapPath("~/SiteSettings.xml") return c:\Projects\StackOverflow\www\SiteSetting.xml. I need a way to get a path like c:\Projects\StackOverflow\StackOverflow.Data\SiteSetting.xml</p>
