Monday, January 30, 2012

Debugging webpart

It was very helpful in knowing how to fix the breakpoint and debug the code for custom written webpart during a sharepoint pageload event.

1. Browse the sharepoint site.
2. Use Debug -> Attach to process from the webpart which is kept open in .net env. Choose the w3wp process from the list.
3. When the page which uses the webpart is loaded, we can see the breakpoint hit.


Note, To spot the actual w3wp process which points to the site, we use this,
1. Open a notepad
2. Type


"C:\windows\system32\inetsrv\appcmd.exe list wp
Pause"

3. Save the notepad as "WProcess.cmd"
4. Double click the cmd file which will list the port against the process id.

No comments: