Archive for March, 2012

Identify the worker process (w3wp) associated with my application only

March 5, 2012 1 comment

Hi Friends,

I am here again to discuss a small problem which you may or may not faced previously, related to the worker process and SharePoint debugging.

While developing the custom SharePoint artefacts like custom web parts, event receivers, application pages etc. We need to debug to check what is going wrong with the code written by us.

What we normally do while attaching in IIS6 days was to use ‘iisapp.vbs’ file in System32 folder. But it is replaced with something other with IIS7.

Normally developers attach all the running worker process to debug the code. I said initially that you may or may not face this problem as if you are the only developer working on a server then you may not face this issue but if another developer is sharing a server with you for development and if he/she attaches all the running worker processes then you my wonder why your part of code is not working and looking like hanged stat. This may because some other developer attached all the w3wp’s running.

So what’s the solution to identify and attach to only specific worker process running for my application?

  1. Go to Run  ==> cmd ==> enter or if you are not administrator then run command prompt as administrator.
  2. Write following command
    cd Windows\System32\Inetsrv ==> enter
  3. Now run following command to get the list of worker processes associated with the app
    appcmd.exe list wp ==> enter

You will get the result as shown in bellow screen shot.

Form this you will get the worker process ID in double quotes, example WP with ID “4996” is associated with SharePoint central administration application. So you can choose that worker process with the same ID against your application in visual studio while debugging.

Happy Coding….