I am using a DateTime value to set the StartBoundary of several Triggers (daily, weekly, monthly).
I am loging the DateTime and StartBoundary after assignment.
The two values are equal.
But when I finally call the RootFolder.RegisterTaskDefinition method and check the Windows System Task Scheduler, I get correct trigger Days, however incorrect Start Time
I am loging the DateTime and StartBoundary after assignment.
The two values are equal.
But when I finally call the RootFolder.RegisterTaskDefinition method and check the Windows System Task Scheduler, I get correct trigger Days, however incorrect Start Time
//example
using (TaskService ts = new TaskService())
{
TaskDefinition taskDef = ts.NewTask();
taskDef.RegistrationInfo.Description = "Any Description";
DailyTrigger dt = new DailyTrigger();
dt.StartBoundary = scheduleTime; //(DateTime Value
taskDef.Triggers.Add(dt);
taskDef.Actions.Add(new ExecAction(
"my.exe", "ags", null));
ts.RootFolder.RegisterTaskDefinition(@"MyTask", taskDef);
}