Wednesday, March 18, 2009

When I try to attach the debugger to the W3WP.exe process to debug, I always see multiple instances of it. Which one should I attach to?

Ok, this is easy too. Just follow the following steps.

Open the command prompt window, run IISAPP to get a list of the current instances of W3WP.exe.

Note the PID of the instance that corresponds to your web application.

Now return to VS, select Debug -> Attach to process and attach to the W3wp.exe instance with an ID equivalent to the PID you got in step 2 -> click Attach.

Now you can trace through the code and find the error causes easily.

But the question still remains, why sometimes are they more than one w3wp.exe instance? This is because the SharePoint Administration Site Collection and the SSP Administration site always have their own Application pools for error isolation purposes.

2 comments:

Manab Ranjan Basu said...

its really good.It will help a lot of peole like me who are just starting Asp.NET

Indra said...

Its a wonderful piece of white paper.Beginners in ASP.Net like me will be benefited a lot!!!!

Cheers!!!
Indra