Getting the application roots
<p>I am trying to get the my application's physical and relative root programatically, but I am having some problems. I was easily able to get the physical path using <code>HttpContext.Current.Server.MapPath("~/")</code>, but the relative root is proving tricky.</p>

<p>I tried the recommended solution of doing:</p>

<pre><code>HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host
</code></pre>

<p>But this just gave me <code>htpp://localhost</code>, removing the last <code>.com/</code> part.</p>

<p>My only solution was to access the full URL and try to get the domain by breaking down the string, but I am wondering if there is a better way to do it.</p>

<p>Thanks.</p>
