Quartz.Net JobExecutionContext missing referance?
-
13-06-2021 - |
Question
I started to implamenet first sample on quartz.net 2.0.1 but it gives an error.
I created an asp.net web aplication called QuartzSample
my simple code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Quartz;
namespace QuartzSample
{
public class Quartz : IJob
{
public void Execute(JobExecutionContext context)
{
SendMail();
}
private void SendMail()
{
// ...
}
}
}
Error :
The type or namespace name 'JobExecutionContext' could not be found (are you missing a using directive or an assembly reference?)
Solution
I couldn't find JobExecutionContext, however, I did find IJobExecutionContext. I believe that is the former's replacement.
[edit] Found the migration guide: http://quartznet.sourceforge.net/migration_guide.html
From the looks of things they've changed a bunch of classes to interfaces. If you have Visual Studio, Intellisense should be able to help you find the right interface to use.
The tutorial hasn't been updated to accomadate 2.0 changes.
OTHER TIPS
Basically you have to change all classes
JobExecutionContext
to interfaces
IJobExecutionContext
if you are using NetCore install Abp.QuartzCore instead of Abp.Quartz