Using Quartz.Net I want to manually trigger a job without a schedule (for now). However the job runs on startup (which I don't want), then fails to respond to a manual trigger (main problem).
private IScheduler _scheduler;
public void SetupAndTestScheduler()
{
ISchedulerFactory sf = new StdSchedulerFactory();
_scheduler = sf.GetScheduler().Result;
_scheduler.Start();
_scheduler.ScheduleJob(
new JobDetailImpl(nameof(TestDataJob), typeof(TestDataJob)), null);
// manually trigger the job
_scheduler.TriggerJob(jobKey: new JobKey(nameof(TestDataJob)));
}
public class TestDataJob : IJob
{
public Task Execute(IJobExecutionContext context)
{
// blah blah blah
}
}
I'm on NetStandard2.0, with Quartz.Net Alpha 3. I'm wondering whether this is a problem with version 3?