Thursday, June 19, 2014

Debugging SharePoint 2010 Web Parts from Visual Studio 2010


Most of you probably already have figured this out, but for those of you who still have not, here is how you can debug your web part in Visual Studio 2010:
  1. Deploy your Web Part
  2. Add the Web Part to Page
  3. In your code, create a break point.
  4. Go to “Debug” menu, and choose “Attach to Process”.
  5. Under “Attach to:” section, click on “Select …” button.
  6. Uncheck all options, checking ONLY “Managed (v2.0, v1.1, v1.0) code”.
  7. Check the “Show processes in all sessions” checkbox.
  8. Select all “w3wp.exe” Processes, then click on the “Attach” button.
  9. Run your page that contains the Web Part. You should now hit your break point, and will be able to step through your code.

No comments:

Post a Comment