title: How to get the root url at startup in an OWIN asp.net Web API
body: <p>I have found many posts very similar to this, but I didn't find any that worked for me.</p>
  
  <p>I have an asp.net Web Api2 (not vnext) application, running under IIS, and using the Owin Startup class.</p>
  
  <p>When installed, the root url to this will be something like</p>
  
  <pre><code>http://localhost/appvirtualdirectory
  </code></pre>
  
  <p>where <code>appvirtualdirectory</code> is the name of the virtual directory it is configured to run under in IIS.</p>
  
  <p>IS there a way at <em>startup</em> where I have no Request property, ie in the <code>Startup.Configure</code> method, to get the root URL <em>including</em> the virtual directory being used?</p>