I have one problem which refers to quartz.net cron expressions. I have read many articles and tried many pieces of code but without any results, so I feel little bit hopeless and that's why I decided to ask You. Maybe somebody also had similar problem.
Is any way to parse cron expression for quartz.net to DateTime format?
For example I have a cron:
var cron= new Quartz.CronExpression("0 * 8-22 * * ?");
An unhandled exception of type 'System.AccessViolationException' occurred. Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
CronExpression cron= new Quartz.CronExpression("0 * 8-22 * * ?");
DateTimeOffset? nextFire = cron.GetNextValidTimeAfter(dt);
GetFinalFireTime hasn't been implemented yet.
GetNextValidTimeAfter should be working if you're using one of the latest versions.
If you want to generate cron expressions in c# you can use
You can find a simple project here (QuartzNetCronExpressions.zip) where you can see how it works.
NOTE: I've used VS 2013, Framework 4.5.1 and Quartz.net 2.2.1 (nuget package).