This project has moved. For the latest updates, please go here.

How to Repetition.Duration indefinitely

Aug 8, 2011 at 1:51 PM

Good evening,

I am trying to create a task with a indefinitely duration. The problem is that Repetition.Duration must be greater than Repetition.Interval. If I set Repetion.Duration to zero, it gives an exception running on XP (because of V1).
Is there a way to solve it?

Regards

Coordinator
Aug 8, 2011 at 3:16 PM

Under XP, if Duration is 0 to signify Indefinite, then Interval must be 0. The logic is that if a task is allowed to run forever, then there should be no interval at which it will restart.

Aug 8, 2011 at 7:23 PM

I've set duration to one day and now it is ok. Thanks for help

Mar 10, 2015 at 10:11 AM
Hi dahall,
I have been using your library for more than 3 years now..and its just amazing.

But recently i came across a scenario where i needed to configure a task hourly for indefintely time frame.

That is i need to set trigger.repetition.duration = INDEFINITE.

How to do that?
Coordinator
Mar 11, 2015 at 5:51 PM
Trigger.Repetition.Duration = TimeSpan.Zero
Marked as answer by dahall on 3/11/2015 at 9:51 AM
Mar 13, 2015 at 2:53 PM
I did try to use that but my task needs to be repeated hourly. So i have to set the trigger.Repetition.Interval to 1 hr timespan value and then while creating the task it complains that trigger.Repetition.Interval needs to be lower than trigger.repetition.duration