I have an issue on my SharePoint 2007 portal, where i created a custom TimerJob, but when I deploy it i get a message:
MyTimerJob cannot be deserialized because it does not have a public default constructor.
I perfromed a research and i applied some solutions where provided but I still have the same issue!
Here is the code:
public CustomTimerJob()
: base()
{ }
public CustomTimerJob(string name, SPService service, SPServer server, SPJobLockType lockType) :
base(name, service, server, lockType)
{}
public CustomTimerJob(string name, SPWebApplication webApplication) :
base(name, webApplication, null, SPJobLockType.ContentDatabase)
{
this.Title = "XML Retriever";
}
public override void Execute(Guid contentDbId)
{
//Perfrom work
}
And here is my feature activation:
MyTimerJob customTimerJob = new MyTimerJob(JOB_NAME, site.WebApplication);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond =50;
schedule.Interval = 50;
customTimerJob.Schedule = schedule;
customTimerJob.Update();
Anyone has any idea what the problem could be?
