Debugging SharePoint Timer Jobs
Before I begin, I'd like to point out Andrew Connell's blog entry on creating custom SharePoint timer jobs. It's an excellent starting point.
The process of debugging the timer job is straight forward.
1) Since the assembly for the timer job is deployed to the GAC, you'll need to put a copy of the PDB file in %SYSTEMROOT%\Assembly\gac_msil\<Assembly Name>\<Version__PublicKey>. Once there, Visual Studio will be able to properly load the debug symbols.

2) In Visual Studio, attach to the OWSTIMER.EXE process. OWSTIMER.EXE is the Windows service that runs the timer jobs.

Once attached to OWSTIMER.EXE, any breakpoints you set will be hit when the timer job is run.
UPDATE (10/11/2007 4:10PM PDT): You'll need to restart the Windows SharePoint Services Timer service (OWSTIMER.EXE) each time you make any change that will effect how your code behaves (i.e. deploying a new version to the GAC, changing a config file value, etc.) in order for the change to take effect.
Similar Posts
- Running different versions of the same assembly
- March 21, 2007 Ask An Expert Live Chat Experts
- Disappearing Visual Studio 2005 Menu Items





Comments
AC [MVP MOSS] on on 10.11.2007 at 1:34 PM
Thanks for the kind words on the post... glad it helped! You'll see more content coming for creating custom timer jobs in the next few months. :)
MV on on 6.09.2008 at 7:01 AM
thanks so much