Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012: Unable to attach the process. A debugger is already attached

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.

like image 333
mtkachenko Avatar asked Jul 07 '14 08:07

mtkachenko


People also ask

How do I Debug by attaching a process in Visual Studio?

You can attach the Visual Studio debugger to a running process on a local or remote computer. After the process is running, select Debug > Attach to Process or press Ctrl+Alt+p in Visual Studio, and use the Attach to Process dialog to attach the debugger to the process.

How do you attach a debugger to a process?

You can attach to a running process using Tools | Attach to Process . If it's a Web Application, you can attach to it by attaching to aspnet_wp.exe or w3wp.exe .

What does it mean to attach a debugger?

That means to attach a debugger (i.e visual studio's integrated debugger) to the process so you can pause it and inspect variables at runtime. This happens when you hit F5 automatically, or can be done manually using the debug menu. Follow this answer to receive notifications.

How do I insert a w3wp process in Visual Studio?

Open Visual Studio in Administrator Mode, then Debug -> attach to process -> tick the check box "Show processes from all user", select w3wp.exe. Administration mode is required for debugging the source code.


2 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.

like image 111
mtkachenko Avatar answered Sep 28 '22 04:09

mtkachenko


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.

like image 25
Erlend Robaye Avatar answered Sep 28 '22 06:09

Erlend Robaye