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:
- Deploy your Web Part
- Add the Web Part to Page
- In your code, create a break point.
- Go to “Debug” menu, and choose “Attach to Process”.
- Under “Attach to:” section, click on “Select …” button.
- Uncheck all options, checking ONLY “Managed (v2.0, v1.1, v1.0) code”.
- Check the “Show processes in all sessions” checkbox.
- Select all “w3wp.exe” Processes, then click on the “Attach” button.
- Run your page that contains the Web Part. You should now hit your break point, and will be able to step through your code.
This should help speed up your development considerably if you are not using this method already.