How to Debug a webpart in sharepoint 2003 or Moss 2007
1.Open the site where you deployed your webpart.
2.open command prompt type iisapp.vbs
3.It will list out all the W3WP.exe
eg.
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.
1.now open visual studio.net your webpart solution
2.on Click Debug Option
3.select 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
like
protected override void CreateChildControls()
{
}
and
method
protected override void Render(HtmlTextWriter output)
{
}
press F11 to debug step in
i.e line by line
Good one
Chandrashekar Thota(Editor, MVP)