Debugging SharePoint 2010 – A Neat Trick

Learnt something yesterday I never knew.  This is from my good friend Andy Maggs a co-worker at Ridgian. Despite the great tools in Visual Studio these days for working with SharePoint there are still occasions when you need to manually connect to the w3wp.exe processes which run in IIS in order to debug.  The trouble is – which one do you connect to?  There are often 5 or 6 running.  Normally I just connected to them all and to hell with it, but Andy showed me a neat trick.

Open up IIS manager and select the root node, in the icons in the centre panel, you’ll see “Worker Processes”.    Click on there and wait a few seconds for it to refresh. Low and behold you’ll see the Application Pools against the process IDs.  Now when you go to attach to a process in Visual Studio, you’ll know which one(s) to connect to.

[Update : Obviously if you do an IISRESET or Recycle App Pool or deploy a Farm Feature, you will need to re-find the Process number!]

 

Nice one Andy.

Cheers

Dave Mc

Advertisements

About davemcmahon81
Software Developer & Architect, User Group Leader, Speaker, Writer, Blogger, Occasional Guitarist, Man-made Global Warming Sceptic, Climate Change Believer, General Optimist but most of all proud Husband and Dad ...

2 Responses to Debugging SharePoint 2010 – A Neat Trick

  1. Brian Scott says:

    Another way which might be quicker (I have it in a .bat file) is to run the following from the command prompt;

    %windir%\system32\inetsrv\appcmd.exe list wp

    Hope that’s useful 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: