Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Debugging is stuck at "Attaching to the web server"

When I run my Web API application I get the following window:

Attaching to the web server

It just stays like that indefinantly, until I hit cancel.

When I do hit cancel, this error message is shown:

Catastrophic Failure

I have tried rebooting, and running iisreset /restart but it does not fix it.

Any ideas what I can do to get my debugger working again?

NOTE: My Web API 2 project's Servers setting is set to Local IIS. My service is hosted by IIS and when I am not debugging, it works fine.

like image 591
Vaccano Avatar asked Oct 27 '16 16:10

Vaccano


5 Answers

I just did a reset for all the settings for VS and it worked again.

Tools => Import and Export Settings => Reset All Settings

good luck!

like image 32
Mu'men Tayyem Avatar answered Oct 02 '22 21:10

Mu'men Tayyem


A possible fix:

Check the "Enable Just My Code" in Tools->Options->Debug

like image 114
Kamarey Avatar answered Oct 02 '22 23:10

Kamarey


I had this issue for Visual Studio 2017 and like with the previous post I had Debugging option "Enable .NET Framework source stepping" ticked. Un-ticking fixed the issue.

like image 29
user8055899 Avatar answered Oct 02 '22 23:10

user8055899


So as I commented before I had this same issue, but I now figured out the cause and have a solution.

I just got a new machine last week (this issue was actually one of the reasons why) and after a while I had the same issues, not being able to debug my projects. Luckily because I was installing all the updates one by one I was able to pin-point when it started happening.

It seems the latest update for the "Microsoft ASP.NET and Web Tools" extension breaks something.

Sadly, uninstalling or reverting the Web Tools extension is not easy: Remove this extension by going to the Windows control panel and modifying your Visual Studio installation. I had to remove Visual Studio completely and reinstall it (repair didn't do the trick). You can update and install all your extensions as you wish, just make sure that you don't update the Web Tools extension

I tested this on my old machine and it did the trick there as well.

I've also created an Issue on GitHub as I won't be updating the extension until this is fixed, if anybody has additional information please add it to the Issue.

like image 20
Sc0tTy Avatar answered Oct 02 '22 22:10

Sc0tTy


In Visual Studio 2015, go to Tools -> Options -> Debugging and deselect "Enable .NET Framework source stepping". This may relate to an issue with loading symbols, so if you want to keep the ability to debug .NET Framework source, then it may help to search the web for how to clear the symbol cache, or preload it, or set your symbol server, and so on.

Enable .NET Framework source stepping

like image 26
ErikE Avatar answered Oct 02 '22 21:10

ErikE