Tuesday, October 21, 2008

STSDEV Debugging for WebPart, Site Definition or workflow.

After deploy the app (webpart etc) into SharePoint site, you want to debug your app as below steps:

  1. Enable debug in project properties.

    Right click project and click properties, click [Build] in left panel.
    Select the method in Configuration which is the deploy method you just done.
    Click to select both "Define DEBUG constant" and "Define TRACE constant".
    Click right-bottom "Advanced.." button and change [Debug Info:] to "full".
    Click [OK] and save all.
  2. Set breakpoint in debug area of your program
  3. Run "iisapp" in command line to choose which SharePoint run time "w3wp.exe" you should pick up. You can pick it by your running sharepoint site name.
  4. Click menu [Debug] - [Attach to Process...], and click the picked "w3wp.exe" and click [Attach] button, go on click [Attach] button on pop up warning window.
  5. Back to the page which host your app (webpart) and refresh or redeploy.

You will see the debug yellow bar pausing on your code for now. You can now use same debugging method by F11/F10 of VS.

No comments: