title: Debugging MVC application in VS2012 attempts to start IIS Express twice
body: <p><strong>UPDATE</strong></p>
  
  <p>I'm certain this is a Visual Studio bug with no obvious solution.  I've encountered a number of people who have the same exact issue.  I have submitted a bug ticket with Microsoft here:</p>
  
  <p><a href="http://connect.microsoft.com/VisualStudio/feedback/details/778864/vs2012-is-spawning-two-iisexpress-processes-when-attempting-to-debug" rel="nofollow noreferrer">http://connect.microsoft.com/VisualStudio/feedback/details/778864/vs2012-is-spawning-two-iisexpress-processes-when-attempting-to-debug</a></p>
  
  <p>If you are having the same issue as described below, <em>please</em> go vote up the bug ticket so that it gets more attention.</p>
  
  <hr>
  
  <p>Whenever I attempt to debug an MVC3 (or MVC4) application in Visual Studio 2012 configured to run on IIS express (version 8), I get the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/eVz5i.png" alt="enter image description here"></p>
  
  <p>Here's the kicker: IIS Express <em>is</em> starting, even though Visual Studio doesn't think so and the debugger fails to attach.  The IIS Express tray opens and I can clearly see all configured websites are started:</p>
  
  <p><img src="https://i.stack.imgur.com/d0oIt.png" alt="enter image description here"></p>
  
  <p>Oddly enough, the IIS Express System Tray reports that there were some errors when running IIS Express.  Here's what it says:</p>
  
  <p><img src="https://i.stack.imgur.com/pkwtv.png" alt="enter image description here"></p>
  
  <p>This is a serious WTF.  It's reporting that 8080 is being used by an IIS Express Process - the one that was <em>just</em> started by Visual Studio.  So, Visual Studio is attempting to launch IIS twice, and when it predictably fails the second time, the debugger bails.  I should note that before launching the debug configuration in Visual Studio, I made <em>absolutely sure</em> no IIS Express processes were already running.  I used Process Monitor to verify that Visual Studio is in fact attempting to launch IIS Express twice:</p>
  
  <p><img src="https://i.stack.imgur.com/E2Hlb.png" alt="enter image description here"></p>
  
  <p>Notice in the screen shot above you can clearly see websites running on IIS Express PID 4732.  PID 4924 is the second failed attempt at launching IIS Express.</p>
  
  <p>This issue was initially occurring on a Windows 7 installation.  I reformatted completely, installed a fresh copy of VS2012, and got the same issue.  I went a step further and reformatted, installed Windows 8 and a fresh copy of VS2012, and the issue persists.  </p>
  
  <p>I have created brand new blank MVC3 and MVC4 projects.  <em>Nothing fixes it.</em></p>
  
  <p>I'm tearing out my hair here.  Any help would be greatly appreciated.</p>