2012-06-11 68 views
0

我開始在quartz.net 2.0.1上植入第一個樣本,但它給出了一個錯誤。Quartz.Net JobExecutionContext缺少參考?

我創建了一個名爲QuartzSample

一個asp.net網站aplication

我簡單的代碼:

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() 
     { 
      // ... 
     } 
    } 
} 

錯誤:

The type or namespace name 'JobExecutionContext' could not be found (are you missing a using directive or an assembly reference?) 

回答

5

我找不到JobExecutionContext,但是,我確實發現IJobExecutionContext。我相信這是前者的替代品。

[編輯]發現遷移指南:http://quartznet.sourceforge.net/migration_guide.html

從事情,他們已經改變了一堆的類接口的樣子。如果你有Visual Studio,Intellisense應該能夠幫助你找到合適的界面來使用。

本教程尚未更新爲accomadate 2.0更改。

+0

JobExecutionContext在石英1.0實施.3(https://quartznet.sourceforge.io/apidoc/1.0/html/) –

0

基本上,你必須改變所有類

JobExecutionContext 

到接口

IJobExecutionContext 
0

,如果你使用的是磊科安裝的,而不是Abp.Quartz Abp.QuartzCore