While working with a couple different types of event receivers in Visual Studio 2010, I noticed an inconsistency between the ‘item added/adding events’ and the ’email received’ event receiver in terms of deployment from Visual Studio.When deploying from Visual Studio via the F5 key everything worked as expected with the item added/adding events.This is also true for the latter, but only upon the very first deployment.I made a few minor changes to my code, redeployed the event receiver (which includes an automatic IIS reset), and discovered no changes had been made.The original code from the first deployment of the ‘Email Received’ event receiver was firing instead.
After doing some researching I learned that the ‘SharePoint 2010 Timer’ contains it’s own cached copy of the original dll. An IIS reset alone will not update the Timer’s cache.The solution is to restart the SharePoint 2010 Timer service after each IIS reset. This will refresh the timers cache with the most current assembly.
The blog below contains some great tips on debugging SharePoint Timer jobs.