title: How do I get the base URL of My Web Application?
body: <p>Is it possible to get the base URL of a web site hosted in IIS 7 by using <code>Microsoft.Web.Administration.ServerManager</code>?</p>
  <p>In the simplest scenario, this would be:</p>
  <pre><code>http://localhost
  </code></pre>
  <p>but I need to get it programmatically.</p>
  <p>If I can't use <code>ServerManager</code> what is the best alternative?</p>