I was trying to make use of the custom service appliaction which I got from the source, http://msdn.microsoft.com/en-us/library/gg193964.aspx, to make it automated by associating with a timer job. When I'm running the application, the timer job is not hitting. When I try to debug the code it is not hitting at all. Please help me out with this.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using CriticalPath.SharePoint.Samples.WingtipCalculator;
namespace SampleTimerJob
{
public class SampleJobDefinition : SPJobDefinition
{
public const string JobName = "SimpleJobDefinition";
public SampleJobDefinition() : base() { }
public SampleJobDefinition(SPService svcApp) :
base(JobName, svcApp, null, SPJobLockType.Job)
{
Title = "Simple Job Definition";
}
public override void Execute(Guid targetInstanceId)
{
//SPWebApplication webApp = this.Parent as SPWebApplication;
SPSite mySite = new SPSite("http://ussecavdspdwk09/tax");
SPWeb myWeb = mySite.OpenWeb();
SPServiceContext mySiteContext = SPServiceContext.GetContext(mySite);
// SPServiceContext mySiteContext = SPServiceContext.GetContext(mySite);
CalcServiceClient client = new CalcServiceClient(mySiteContext);
client.AddTask(mySite.Url);
}
}
}