I'm trying to follow http://msdn.microsoft.com/en-us/library/cc406686.aspx and similar tutorials. I've got a custom SPJobDefinition derivative and a feature. The definition doesn't do anything yet, since I'm just trying to get it setup. The feature has the following code in the FeatureActivated:
// Get the Site Collection in which this is being activated
SPSite siteCollection = (SPSite)properties.Feature.Parent;
// Make sure the job isn't already registered
foreach (SPJobDefinition jobDefinition in siteCollection.WebApplication.JobDefinitions)
if (jobDefinition.Name.Equals(TIMER_JOB_NAME))
jobDefinition.Delete();
// Create the job
Form40EscalationTimer timerJob = new Form40EscalationTimer(
TIMER_JOB_NAME,
siteCollection.WebApplication,
null,
SPJobLockType.Job
);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = int.Parse(ConfigurationManager.AppSettings["Form40EscalationJobIntervalMinutes"]);
timerJob.Schedule = schedule;
timerJob.Update();
// Install the job - not here originally, tried from http://www.codeguru.com/cpp/misc/misc/microsoftofficeoutlook/print.php/c14133__1/
siteCollection.WebApplication.JobDefinitions.Add(timerJob);
siteCollection.WebApplication.Update();
What am I missing? It all deploys fine, and the feature activates fine, but it doesn't show up in the list of job definitions!