Internet Explorer Developer Toolbar – JS Debugger Error "Unable to attach the process. Another debugger might be attached to the process" .
- Run an ASP.NET application from Visual Studio.
- Once application launched, Press F12 in browser to launch Developer Toolbar.
- Move to "Script" Tab and Click on "Start Debugging". Put the necessary breakpoints on the script function as required before click.
On click of "Start Debugging", you will receive the below error message. which says, already another debugger attached and you cannot attach with current Internet Explorer Process for debugging.
Follow the below steps for resolve this issue.
- Go back to Visual Studio and Select "Detach All" from "Debug" menu.
- Now click on "Start Debugging" from Internet Explorer Developer Toolbar. No error, and you can continue with debugging and other work.
Behind the Scene
Visual Studio automatically instantiates an Internet Explorer process to launch the web sites. You can check the process level using "Process Explorer".
Which means, while your site is running in browser, "iexplore.exe" (Process for Internet Explorer) is already attached. One of the most simplest ways to check this out is, navigate to Debug > Windows> Processes. This will list out all attached processes within Visual Studio. For any typical ASP.NET web application which is running from Visual Studio will have two processes and iexplore is one of them.
That’s why when you are trying to attach the same process from Internet Explorer Developer toolbar, it is throwing an error "Unable to attach the process. Another debugger might be attached to the process" .
So now we know what was causing the issue and let’s have a look at what we did to resolve this.
As a resolution, we used "Detach All" from debug menu, which actually detached all the processes which are attached with Visual Studio except local ASP.NET Development server process (WebDev.WebServer40.EXE).
Note: "Detach All" will detach all the attached process apart from ASP.NET Development server. Because detaching the development server is nothing but stopping your application. If you want to stop, either stop debugging or "Terminate" the local development sever process.
"Detach All" will remove iexplore.exe from the list of attached process. So, you can go ahead and start the debugging in Internet Explorer Developer toolbar.
Detaching a Particular Process Instead of "Detach All"
If there are multiple processes attached and if you want to detach only "IE Process", you can simply do it from process attach window, by selecting "Detach Process" from the content menu of the "iexplore.exe". This will help you to retain other process in attached state.
To know more about Processes Window, check out this post:
Hope this helps!