A frequent problem that occurs to me while developing within SharePoint is the fact that my debugger refuses to catch events, often indicated by empty circles on the breakpoints pane. Usually the cause is always different, so I’ve started logging fixes and have a checklist for quick reference if this occurs.

The SharePoint Debugger Fix List:

  1. Verify VS project site URL. You ARE deploying to where you think you are, right?
  2. Check that you are not compiling in release mode
  3. Clean, rebuild, redeploy the solution
  4. Run IISReset command from Start -> Run
  5. Check post build log warnings
  6. Delete the pkg/obj/bin folders within your solution directory, rebuild/deploy
  7. Ensure your project is actually deploying. Check that add solution is part of your deploy from project properties.
  8. Restart

*Note that there are likely a few other things that may cause this issue but this has often covered 99% of my issues. Be sure to check your debug build settings/symbols output for example. Was there a recent change you did to the project? Perhaps start looking there.

Feature Receivers:

Feature receivers involving web templates are trickier to work with.

  1. Try using System.Diagnostics.Debugger.Launch(); in your code to force the debugger to prompt for access when the code is hit. This is VERY useful for feature receivers.
  2. Retract solution, remove orphaned features, then retry.

Timer Jobs:

You must attach the debugger to owstimer.exe in order to debug such code. After deploying new code the timer service must be restarted (iisreset will not suffice)

net stop sptimerv4
net start sptimerv4

Further Troubleshooting:

I often like to make sure that the code in the Global Assembly Cache is actually there, to do so I do the following:

  1. Run ilspy which lets you look at code inside DLL’s. From the menu you can grab a DLL from the global assembly cache. Make sure yours is there, if it is, open it up and check the code structure. See if your latest changes are in there, if not, your deployment is not completing correctly.
  2. If #1 reveals that code is not part of the GAC, check your solutions bin folder and drag and drop your DLL and check that code as well. It may help with understanding why the issue is occuring.

No Comments

There are no comments related to this article.