using (TaskService ts = new TaskService())
{
TaskDefinition td = TaskService.Instance.NewTask();
td.RegistrationInfo.Description = "Keep Alive";
DailyTrigger wt = new DailyTrigger();
wt.Repetition.Interval = TimeSpan.FromMinutes(1);
td.Triggers.Add(wt);
td.Actions.Add(test);
TaskService.Instance.RootFolder.RegisterTaskDefinition("Keep alive", td);
}