Cannot generate occurences

Hello,

What’s wrong with the following code as it writes nothing to the console?

RecurrencePattern pattern = new RecurrencePattern();
pattern.StartDate = new DateTime(2005, 1, 1, 9, 0, 0);
RecurrenceRule rule = pattern.RRules.Add();
rule.Frequency = Frequency.Daily;
rule.EndType = EndType.Until;
rule.Until = new DateTime(2008, 1, 31, 9, 0, 0);
rule.ByMonth.Add(1);

DateCollection dates = pattern.GenerateOccurrences();

foreach (DateTime d in dates)
Console.WriteLine(d);

It should be putting the dates to the console…

Thank you.

Hi,

The evaluation version has limit for calculation to end of 2004 ( DateTime(2004, 12, 31, 23, 59, 59) ).

You should set licence for using the full version:

License license = new License();
license.SetLicense("Path to your licence file");