Debugging Web Parts in SharePoint 2007 - Zlatan's Blog [MVP SharePoint]

Debugging Web Parts in SharePoint 2007

Ok in my previous article I covered basic SharePoint 2007 Web Part Development, (this is another thing I've been asked a lot) one important thing when it comes to development especially more complex web parts is debugging and stepping through the code.

This is super easy so here you go....................

So..... you finished developing your Web Part, and you pressed Crtl+Shift+B and your Build went fine, but you get errors displayed when you test your Web Part in SharePoint 2007, so what do you do now?

1. First you right-click on your project file in the solution explorer and click on "Properties".

2. Then under the Build section you change the Output path to the bin directory in the Virtual Directory of the web application under which you want to debug your web part (this is another way to deploy your web parts besides already mentioned ways in my previous post http://dotnet.org.za/zlatan/archive/2008/03/25/developing-basic-web-parts-in-sharepoint-2007.aspx).

3. Build your project/solution (Crtl+Shift+B)

4. Next under Debug you select Attach to Process.

5. You select w3wp.exe from the list of processes (if there is more than one, then select them all just to be on the safe side).

 

6. I hope you didn't forget to put a break point in your code and now debug away.

Published Tuesday, March 25, 2008 7:54 PM by Zlatan

Comments

# Links (3/26/2008) « Steve Pietrek’s SharePoint Stuff

Pingback from  Links (3/26/2008) « Steve Pietrek’s SharePoint Stuff

Thursday, March 27, 2008 12:16 AM by Links (3/26/2008) « Steve Pietrek’s SharePoint Stuff

# Latest SharePoint News 03.27.08 | SharePoint BUZZ

Pingback from  Latest SharePoint News 03.27.08 | SharePoint BUZZ

Friday, March 28, 2008 4:23 AM by Latest SharePoint News 03.27.08 | SharePoint BUZZ