Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug two web applications/services on IIS from within Visual Studio?

Tags:

In Visual Studio 2010, I want to debug two web applications running on IIS at the same time. When debugging the first application it is ok. But when starting to debug the second application and first program is still in debug mode, Visual Studio prompts:

unable to start debugging on the web server. a debugger is already attached

How can I solve this problem?

like image 432
Morteza Avatar asked Feb 04 '12 12:02

Morteza


2 Answers

To summarize, one has to set different application pools in IIS for the two applications to debug.

Here is a rough instruction, given that both applications have been deployed to IIS once within Visual Studio.

  1. Open the Internet Information Services (IIS) Manager
  2. Click Application Pools on the left pane
  3. On the right pane add another integrated application pool, let's name it Second ASP.NET 4.0 Integrated
  4. For one application, open the Advanced Settings...
  5. In the properties view finally select Second ASP.NET 4.0 Integrated as the application pool

This way the applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.

like image 118
rmoestl Avatar answered Sep 28 '22 00:09

rmoestl


A windows process can only have one debugger attached to it at a given time. If you get that message it means that you're attempting to debug the same process twice which won't work. But that also means you should be able to debug both web applications in the instance of Visual Studio that's already attached. It may require a few extra steps though to get it to acknowledge the other code

  • Disable "Just My Code" (Tools -> Options -> Debugger, uncheck "Enable Just My Code"
  • You may need to manually load symbols for the other web application through the modules window (Debugger -> Windows -> Modules)

After that though (second step may not be necessary) you should be able to set break points in both web applications and otherwise debug them.

like image 36
JaredPar Avatar answered Sep 28 '22 00:09

JaredPar