I am getting below error when I try to deactivate a feature. Upon debugging it is failing when trying to delete the job (that is job.delete in the code snippet below).
I have observed that both feature activation/deactivation from 'site collection feature' link fails.
I am guessing it is a permission issue even though my account is included in site collection admin as well as farm admin. Please suggest if any other accounts (app-pool, system etc) needs any other permissions etc.
Below is the code snippet
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
SPSite site = properties.Feature.Parent as SPSite;
// delete the job
foreach (SPJobDefinition job in site.WebApplication.JobDefinitions)
if (job.Name == TASK_LOGGER_JOB_NAME)
View Complete Post