Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: setting the StartBoundary to a valid DateTime not working

$
0
0
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
//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);
}

Viewing all articles
Browse latest Browse all 2206

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>