If you are a SharePoint developer, you probably needed to use Visual Studio debugger to debug nasty little bugs in your SharePoint applications at some point. The process to debug applications on SharePoint requires attaching the Visual Studio debugger to your SharePoint IIS worker process (w3wp), but often times you will find that there are multiple w3wp processes running on your machine.
Figure 1: Visual Studio *Attach to Process* menu option
Figure 2: Visual studio *Attach to Process* popup screen showing multiple w3wp processes
If you have this situation, you have two choices:
- Attach debugger to all w3wp processes on your machine
OR
- Read this blog and do it the right way.
If you have chosen 2, continue reading…
Open IIS manager and click on the *Worker Process* icon.
Figure 3: IIS 7 *Worker Process* icon
Figure 4: IIS 7 *Worker Process* screen
Note down the process id of your SharePoint application and compare it with the Ids shown in the Visual studio *Attach to Process* screen (figure 2). This will tell you the exact w3wp process id of your SharePoint application. This little trick will allow you to attach your Visual Studio debugger to just your SharePoint application.
HTH,
Talha