Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is what worked for me (Updated for VS 2013, see revision history for 2010, for <strong>VS 2015</strong> see this: <a href="https://stackoverflow.com/a/32744234/218971">https://stackoverflow.com/a/32744234/218971</a>):</p> <ol> <li>Right-click your Web Application Project ▶ <code>Properties</code> ▶ <code>Web</code>, then configure the <code>Servers</code> section as follows: <ul> <li>Select <kbd>IIS Express ▼</kbd> from the drop down</li> <li>Project Url: <code>http://localhost</code></li> <li>Override application root URL: <code>http://dev.example.com</code></li> <li>Click <kbd>Create Virtual Directory</kbd> (if you get an error here you may need to disable IIS 5/6/7/8, change IIS's <code>Default Site</code> to anything but port <code>:80</code>, make sure <a href="https://stackoverflow.com/questions/22994888/why-skype-using-http-or-https-ports-80-and-443">Skype isn't using port 80</a>, etc.)</li> </ul></li> <li>Optionally: Set the <code>Start URL</code> to <code>http://dev.example.com</code></li> <li><p>Open <code>%USERPROFILE%\My Documents\IISExpress\config\applicationhost.config</code> (Windows XP, Vista, and 7) and edit the site definition in the <code>&lt;sites&gt;</code> config block to be along the lines of the following:</p> <pre><code>&lt;site name="DevExample" id="997005936"&gt; &lt;application path="/" applicationPool="Clr2IntegratedAppPool"&gt; &lt;virtualDirectory path="/" physicalPath="C:\path\to\application\root" /&gt; &lt;/application&gt; &lt;bindings&gt; &lt;binding protocol="http" bindingInformation=":80:dev.example.com" /&gt; &lt;/bindings&gt; &lt;applicationDefaults applicationPool="Clr2IntegratedAppPool" /&gt; &lt;/site&gt; </code></pre></li> <li><p>If running MVC: make sure the <code>applicationPool</code> is set to one of the "Integrated" options (like "Clr2IntegratedAppPool").</p></li> <li>Open your <a href="http://en.wikipedia.org/wiki/Hosts_(file)" rel="noreferrer"><code>hosts</code> file</a> and add the line <code>127.0.0.1 dev.example.com</code>.</li> <li><kbd>► Start</kbd> your application!</li> </ol> <p>Some great advice from the comments:</p> <blockquote> <ul> <li>You may need to run Visual Studio as Administrator.</li> <li>If you want to make other devs see your IIS run <code>netsh http add urlacl url=http://dev.example.com:80/ user=everyone</code> </li> <li>If you want the site to resolve for all hosts set <code>bindingInformation="*:80:"</code>. Use any port you want, 80 is just convenient.</li> </ul> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload