Reader Level:
Articles

Easy way to debug Sharepoint web part or Event handler

By Destin joy on September 06, 2010
I think this is worth enough to show how to debug share point controls (User control, Event handler or web part). It will reduce your time on finding out the issue.
  • 0
  • 0
  • 10348


I think this is worth enough to show how to debug share point controls (User control, Event hander or web part). It will reduce your time on finding out the issue.

1. First you have to build the application and put your DLL in GAC or BIN folder of your web application

2. Then you have to put that web part in share point. If it an event handler you have to register it

3. Then you have to make a break point in the code where you want to break the code for debugging(Please make sure the current version of the code and the dll you placed in BIN or GAC are same)

sharepoint1.gif

4. Then you have to go to DebugSelect Attach to process

sharepoint2.gif

5. From the next screen you have to select all the W3wp.exe process

6. Click Attach

Third.PNG

7.. Make an IIS reset in the share point server and refresh your page where you deployed your web part.

8. Now when the web part loads you can see it is stopped on the section where we added the break point

9. Now you can debug the share point web part as normal as you debug In ASP.Net

Destin joy

Destin Joy is  a Microsoft MVP in SharePoint Server. He is a blogger, author and a Speaker.He also holds Mindcracker MVP and Microsoft Certified TrainerYou can reach him @ Destin.Joy@hotmail.com

COMMENT USING

Trending up