我有一個非常簡單的時間表和一份使用Quartz的工作,當我不使用nancyfx並且在我的global.asax中有MySchedule.Start()
時它工作正常。我在使用nancyfx和bootstrapper.cs一個獨立的MVC項目試過同樣的工作,同樣的時間表,我不知道跑哪裏去了MySchedule.Start()
在Nancyfx項目中使用Quartz。沒有global.asax開始時間表?
我試了一下引導程序內,並沒有工作:
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(Nancy.TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
MySchedule.Start();
}
}
爲什麼在NancyFX中使用ASP.NET MVC? Nancy已經是C#應用程序的API層。我更喜歡創建一個控制檯應用程序,在main中使用topshelf,並在服務啓動時同時啓動nancy(self host)和quartz作業。 – skynyrd