Wednesday, August 17, 2011

A shortcut to debug SharePoint 2010 Solutions

What?

All of us who worked on developing SharePoint 2010 solutions are aware of the frustration involved with debugging them.


Why?


Visual Studio 2010 has introduced F5 debugging support with SharePoint solutions but it is often hard to use it with solutions like workflows, event recievers, custom controls. We still have to go to the Debug menu and choose "Attach to process...", then attach to all the available IIS worker processes (w3wp.exe processes) as shown below:




How?


There is a shortcut to attach the debugger to all the IIS worked processes as demonstrated by  Greg Hurlman in his session at SharePoint Saturday the Conference.

Download "WSP Builder Extensions 2010" from Codeplex.
The current version as of the day of writing this post can be found at WSPBuilder Extensions 2010 BETA 1.4
Install it.

Open Visual Studio 2010 and open a SharePoint solution.
Right click a project in the solution and choose "WSPBuilder" then "Attach to IIS Worker Processes" as shown below:


You can also use keyboard shortcut Ctrl + Shift + Alt + B and then A to do the same.

Here is what you see after the above steps:


As you can notice in the above screenshot, all the IIS Worker Processes have been attached.

Hope that this helps some one.

No comments:

Post a Comment