I built solution, created application in IIS and mapped it to the application folder. It works fine. Then I go to "Attach to Process", there are two w3wp.exe processes in list, but for one of them I get error "Unable to attach the process. A debugger is already attach." I've googled it but I can't find solution for my problem.
6 Answers
I have installed Debug Diagnostic Tool v2.0 and as a result I have Debug Diagnostic Service which is started automatically and attached to one of w3wp processes. After turning off and disabling this service all works fine. So the general rule: if you get such error check processes in task manager which can capture your w3wp process.

- 5,389
- 9
- 38
- 68
-
This was the problem for me! – Matt Watson Apr 28 '15 at 02:31
-
You saved me :) – r.piesnikowski Mar 28 '17 at 06:40
-
Yes, this worked for me perfectly. Starting IIS/APP Pool and a couple of other solutions none of them worked but this one did. Thank you Once again – Sandeep Apr 05 '17 at 18:59
-
@Jerome2606 [Debug Diagnostic Tool v2.0][1] [1]: https://msdn.microsoft.com/en-us/library/ff420662.aspx#Installation – Sandeep Apr 05 '17 at 19:59
-
@Jerome2606 the link worked when answer was added. Now you can just google it. – mtkachenko Apr 06 '17 at 08:07
-
1Thanks! I actually had a Rule for the Application pool configured to collect crash dumps. I removed the rule and was able to attach the debugger. – uceumern Nov 22 '17 at 10:31
-
Stopping the service did not seem to take effect immediately, but after a reboot it did. – Ruud Helderman Mar 05 '18 at 13:14
-
I've no such tool installed recently but have a similar issue and stopping the service fixed the issue, for me problem solved without a restart. – hi0001234d Sep 09 '19 at 06:33
You have 2 instance of VS and two entries in IIS running on the same application pool, for instance Both Server and Intranet are running on the same application pool.
=> Solution open IIS :
° Select the site and click 'Basic Settings' : Here you can check/select the application pool used.
° Click on the "Application Pools" node (right under your computer name) => You get a list of defined application pools.
° Right click under the last one defined to open the context menu and select 'Add Application Pool...' Create a new name and give it the same parameters that the one that was used by your site.
° Select the 'Basic Settings' of one of your sites and change its application pool to the new one just created. => Now Server and intranet have different application pools and your can debug the both at the same time.
Hope this helps.

- 181
- 2
- 3
For me, even after disabling the Debug Diagnostic Tool v2.0 this issue didn't fix. So, I rebuild my webservice, pushed the DLLs on the IIS and restarted the it, which fixed the issue for me. This issue may occur when you make changes in the your web service which is hosted on your local IIS and those changes are not pushed.

- 21
- 5
Debug Diagnostic Tool v2 Update 2
https://www.microsoft.com/en-us/download/details.aspx?id=49924
Can use this link if the link provided by @mtkachenko above doesn't work

- 96
- 1
- 2
Have this in Visual Studio 2019 but after the debugger crashes on occasion. Without restarting the PC, which can be a slow affair, create a temporary second application pool and switching the site over to the new app pool in IIS also works.

- 1,251
- 2
- 16
- 38
Really odd - but this simple thing works for me:
Go to some file in your main project.
Go to Project menu and choose Set as start-up project.
This might seem redundant if you've already chosen that project as the start-up project before, but it seems to work.

- 4,984
- 9
- 37
- 62

- 2,851
- 2
- 17
- 22