title: How to specify a custom url outside of localhost for a new MVC 5 project?
body: <p>I've created a new MVC 5 project, and I'm trying to configure its Project URL to one that's outside of <code>localhost</code> on my local IIS, e.g. <code>http://alpha.domain.local</code>. This is easily done with a new WebForms project, but MVC 5 is providing some resistance.</p>
  <p>I've set an entry in my <code>hosts</code> file:</p>
  <pre><code>127.0.0.1    alpha.domain.local
  </code></pre>
  <p>...and I've created the site in IIS with the correct host header:</p>
  <p><a href="https://i.stack.imgur.com/yORra.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yORra.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/riESU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/riESU.png" alt="enter image description here" /></a></p>
  <p>Here's my attempted project configuration:</p>
  <p><a href="https://i.stack.imgur.com/p3Vvj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p3Vvj.png" alt="enter image description here" /></a></p>
  <p>...and the errors I get when I try to save it:</p>
  <p><a href="https://i.stack.imgur.com/UViIl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UViIl.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/T6QhP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T6QhP.png" alt="enter image description here" /></a></p>
  <p>Here's what I get when I just click the <code>Create Virtual Directory</code> button (even though it already exists):</p>
  <p><a href="https://i.stack.imgur.com/DNLZP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DNLZP.png" alt="enter image description here" /></a></p>
  <p>I can ping it:</p>
  <p><a href="https://i.stack.imgur.com/0WB48.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0WB48.png" alt="enter image description here" /></a></p>
  <p>I can browse to it:</p>
  <p><a href="https://i.stack.imgur.com/CohEK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CohEK.png" alt="enter image description here" /></a></p>
  <p>I just can't point my MVC 5 project to it. MVC 5 stubbornly insists I use <code>localhost</code>, which I don't want to do. I've got some infrastructure built up that relies on these custom host names in my local IIS.</p>
  <p><a href="https://stackoverflow.com/q/31913444">This Q&amp;A</a> <em>kind of</em> gets to the point, but not quite.</p>
  <p>Like I said, this works great with a new WebForms project (VS 2019, latest build). I've been doing it for years. Now that I'm finally getting started with MVC, though, this is a bit of a wet blanket. I'm going to have to redo a bunch of stuff I can't get it working.</p>
  <p>Is this possible? Has anyone else been able to do it?</p>