Why SharePoint Does Not Execute Job Definition Changes

A couple of weeks ago while working on a SharePoint customization it became necessary to use a SharePoint Job Definition.  As the customization progressed I noticed that the job execution was not executing new code modifications made to the job definition.

At first I thought the issue had something to do with the development environment since I had previously encountered some odd debugging and build behaviors in the same environment. 

I inspected the new custom assembly using Reflector.  The assembly was correct.  Then I inspected the SharePoint Solution to make sure the same custom assembly was being packaged up as expected.  No problem there.  The same new custom assembly also made it into the Global Assembly Cache (GAC) as expected during the Solution deployment but yet the job executed by the timer service continued to to be a previous version of the job.

Then I remembered that a while back while working on another project I had discovered that SharePoint has a Configuration Cache on the file system that could get corrupted and could be cleared manually. I realized at that point that SharePoint must be caching the old assembly and hence executing an old version of the job.

This was the case and the fix was simple – restart the Windows SharePoint Services Timer to clear out the previously cached version of the assembly.  A restart of this service was the reason a reboot of the development server always fixed the problem.

Tip: If you want to add a restart of the Windows SharePoint Services Timer service to your build scripts you can issue the following commands:

net stop sptimerv3
net start sptimerv3


Feedback

# re: Why SharePoint Does Not Execute Job Definition Changes

good! 7/19/2010 1:19 AM | Ann

Post a comment





 

Please add 8 and 4 and type the answer here: