How to Debug a webpart in sharepoint 2003 or Moss 2007

1.Open the site where you deployed your webpart. command prompt type iisapp.vbs
3.It will list out all the W3WP.exe


W3WP.exe PID: 3244 AppPoolId: SharePoint - 1001
W3WP.exe PID: 7540 AppPoolId: SharePoint Central Administration v3
W3WP.exe PID: 9016 AppPoolId: SharePoint - 7672
W3WP.exe PID: 1552 AppPoolId: SharePoint - 80

check your site PID. open visual your webpart solution
2.on Click Debug Option Attach to Process
it will list out all process running

eg your site w3wp.exe pID is 1552

In Attach Process window it show like this

Process PID Type UserName Session
W3wp.exe 1552 T-SQl Managed dev\Testuser 0

now clcik on w3wp.exe then click a Attach button

put a break point on your methodes

protected override void CreateChildControls()
protected override void Render(HtmlTextWriter output)
press F11 to debug step in
i.e line by line



Author: ChandraShekar Thota26 Jan 2009 Member Level: Gold   Points : 2

Good one

Chandrashekar Thota(Editor, MVP)

Author: Aslam 27 Jan 2009 Member Level: Silver   Points : 0

Thanks Chandrashekar

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: