Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Catastrophic Failure attaching to IISExpress

I'm having an issue where when I attempt to attach my debugger to IIS express, it fails with a "Unable to attach to the process. Catastrophic failure". It then kills my IIS Express session. I have no clue where to begin debugging this issue.

Steps that lead to this:

  1. My application exists on my local machine
  2. Documents\IISExpress\config\applicationhost.config has the Site set up
  3. I run IIS express via an administrative console mode by going to C:\Program Files\IIS Express\iisexpress.exe
  4. I load up my solution in VS.
  5. I attach attempt to attach my debugger to IIS Express.
  6. I get the catastrophic failure error.
  7. IIS is killed and stopped.

Any idea of where to go for Visual studio logs to see what might have happened? I tried running devenv.exe with the /log option but it did not help with any errors.

I also looked up IIS logs, but nothing out of the ordinary that points to the catastrophic failure.

like image 853
Sirpingalot Avatar asked May 11 '16 16:05

Sirpingalot


1 Answers

Are you running more than one site within the same application pool? I was having the same problem and believe that separating the app sites into different application pools fixed the issue.

Additionally I had issue when the wrong start-up project was selected in Visual studio. Make sure the correct start-up project is selected before attaching, though I can't see why this should matter.

Also I created a controller for the debugger to be launched from the application, which no only makes it much easier, also appears to have less issues.

    #if DEBUG
    public virtual ActionResult Attach()
    {
        System.Diagnostics.Debugger.Launch();
        return new EmptyResult();
    }
    #endif 
like image 78
Dr Jeff Sinclair Avatar answered Sep 19 '22 15:09

Dr Jeff Sinclair