title: How to setup IIS Express to run a Visual Studio project in a Virtual Directory instead of root?
body: <p>I'm using VS 2010 and a using IIS Express instead of the Visual Studio's web server. </p>
  
  <p>By default the Web application runs at the root of localhost something like this: <code>http://localhost:50369/</code></p>
  
  <p>I wish it to run at <code>http://localhost:50369/Enet/</code> instead as this is the virtual directory it will end up at when published.</p>
  
  <p>When I tried to add the virtual directory my applicationhost.config looked this this:</p>
  
  <pre><code>&lt;site name="EssenceNet" id="1"&gt;
                  &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
                      &lt;virtualDirectory path="/" physicalPath="E:\dev\EssenceNet\Src\EssenceNet.Web" /&gt;
                  &lt;/application&gt;
                  &lt;application path="/ENet"&gt;
                      &lt;virtualDirectory path="/" physicalPath="E:\dev\EssenceNet\Src\EssenceNet.Web" /&gt;
                  &lt;/application&gt;
                  &lt;bindings&gt;
                      &lt;binding protocol="http" bindingInformation=":50369:localhost" /&gt;
                  &lt;/bindings&gt;
              &lt;/site&gt;
  </code></pre>
  
  <p>When I browse to <code>http://localhost:50369/</code> my application works.
  When I browse to <code>http://localhost:50369/Enet/</code> my MVC application works, but it can't find files like CSS or JS files. The paths for them are what I'd expect (the same as before except prefixed with <code>/Enet</code>) but they're not found.</p>
  
  <p>What are the steps to do this correctly? Obviously I've gone wrong somewhere.
  Thanks very much for any help.</p>