Debugging SharePoint Timer Jobs

written by Ryan Olshan on Thursday, October 11 2007

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.

Kick this post on .NET Kicks

Similar Posts

  1. Running different versions of the same assembly
  2. March 21, 2007 Ask An Expert Live Chat Experts
  3. Disappearing Visual Studio 2005 Menu Items

Comments

  • AC [MVP MOSS] on on 10.11.2007 at 1:34 PM

    AC [MVP MOSS] avatar

    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

    MV avatar

    thanks so much

Post a comment