Tuesday 7 December 2010

Debugging Sharepoint timer jobs - gotchas

Yesterday I was having a problem... I wasn't able to debug my new timer job. I know VS is automatically attached w3wp.exe so I thought I should be able to debug without any problem. The thing I didn’t know was, that in case I want to debug timer job I should manually attach my VS to owstimer.exe using an option “attach to process” in the debug menu.
All right I was happy to go, did one debug, changed some code and deployed it again, reattach to owstimer, start job manually from central administration, breakpoint hit and… wtf, why is the code behaving so strange, it doesn’t stop on breakpoints etc… What I didn’t know, was the fact, that restarting owstimer is necessary. Remember: Always restart your owstimer.exe

No comments:

Post a Comment