Tuesday, May 29, 2012

Debug SharePoint Event Receiver Feature in Visual Studio

Quickly I will show How to debug Event Receiver Feature (Class Library) in Visual Studio 2008. When user  updates any item in List; break point will stop in Visual Studio.

Note: This post do not focus on configuring Feature.xml and Elements.xml on SharePoint server. 

Please follow below steps to attach debugger to Class Library.

  1. After you deploy DLL in GAC, Open your project.
  2. Put break point.
  3. Navigate to menu Debug -> Attach Process
  4. Search for W3WP worker process. This process start when IE browser start and open SharePoint URL. If you found multiple W3WP process then select all.
  5. That's it.
  6. Open your site on IE browser and try to update item.
Please note, break point will hit though your browser is in another box and Visual Studio is in your SharePoint Server box.

Hope this article have helped you. Enjoy SharePoint...