Debugging SharePoint Code
If you’re hoping to debug code that you’re deploying to SharePoint you’re gonna need too know which w3wp.exe (the code that runs the web app that runs your code) to connect to. The reason you may not know which w3wp.exe to connect to is that each app pool runs a new instance of w3wp.exe and when you select Debug/Attach to Process it’s possible that you may see more than 1. So which one to attach to????
If you start a command prompt and type iisapp you’ll be presented with a list of the app pools that IIS is running – each of which has the name of the application and the PID listed. Attach to the w3wp.exe which has the correct PID alongside it.
This works with IIS6 but apparently not with IIS7 see Michael Lotters blog on this.
Leave a Reply