RaSor’s Blog

October 24, 2008

WSS Dev: HowTo debug a WebPart

Filed under: Sharepoint — rasor @ 4:52 pm

Can you debug a webpart in a WSS page? Yes – not a problem.

Prerequisites:

  • From WSPBuilder make your Webpart (WP). See here.
  • Activate the feature containing the WP
  • Add the WP to a site page
  • Open the page in a browser

Debug:

  • In VisualStudio (VS) set a breakpoint in your WP code
  • RightClick (RC) project – Build (Shift+F6)
  • RC project – WSP – Copy2Gac
  • (RC project – WSP – Recycle) => w3wp.exe will be shutdown and a new one will be created when a request to a page is done.
  • RC project – WSP – Attach – choose w3wp.exe (the one with sql…?) => The breakpoint will be unfilled and not yet be reachable
  • Refresh the browser (F5) => this will load debug info
  • VS: Stop debugging (shift+F5)
  • RC project – WSP – Attach – choose w3wp.exe
  • Refresh the browser (F5) => now your breakpoint will be filled and reached

Thanx to Erik Norström.

1 Comment »

  1. [...] For debugging a WebPart see here. [...]

    Pingback by WSS: Development - Quick Start with WSPBuilder « RaSor’s Blog — October 24, 2008 @ 9:01 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Blog at WordPress.com.