
162
|
Chapter 5, Debugging
#41 Debug a Running Process
HACK
You will almost always want to select Common Language Runtime in the
list of process types to debug. If you are debugging client-side script and
attaching to Internet Explorer, select Script as well. Next, select OK and
close the Processes dialog. Your IDE is now connected to the process you
selected. You can set breakpoints, watch variables, and participate in any
normal debugging task. If the code is in a loop, the Debug
➝ Break All
option will stop the application wherever the current execution point is. You
can then examine the call stack and variables and determine what may be
broken.
Debug ASP.NET Applications Quickly
For those writing ASP.NET applications, the world is even simpler. You will
always be attaching to the same process, the ASP.NET worker process. Sim-
ply open the Debug
➝ Processes dialog and find the aspnet_wp.exe (or
w3wp.exe on Windows Server 2003) process as shown in Figure 5-28.
It’s always the same for all ASP.NET applications, since all ASP.NET appli-
cations run inside the ASP.NET worker process as opposed to individual
processes.
Figure 5-27. Attach to process dialog
Figure 5-28. Select aspnet_wp.exe for debugging