c# - .NET 4.5 Quartz Job not Firing Global.asax.cs Application_Start -


i've been trying quartz.net job fire inside application , having no luck. wrote test app in visual studio 2013 works fine using main method, not firing in actual application.

from i've read, if want run when application pool started need global.asax.cs file placed in app_code folder (note not using mvc). there should method application_start initialize quartz job.

so placed following global.asax.cs:

public class global {     protected void application_start(object sender, eventargs e)     {         system.diagnostics.debug.write("hello via debug!");         // construct scheduler factory         ischedulerfactory schedfact = new quartz.impl.stdschedulerfactory();          // scheduler         ischeduler sched = schedfact.getscheduler();         sched.start();          // define job , tie our hellojob class         ijobdetail job = jobbuilder.create<myjob>()             .withidentity("myjob", "group1")             .build();          // trigger job run now, , every 40 seconds         itrigger trigger = triggerbuilder.create()           .withidentity("mytrigger", "group1")           .startnow()           .withsimpleschedule(x => x               .withintervalinseconds(5)               .repeatforever())           .build();          sched.schedulejob(job, trigger);     } } 

i have job in class (again, works fine in standard .net console app).

    public void execute(ijobexecutioncontext context)     {         log.info("\n--------------------myjob executing via quartz--------------------");         log.info("every 5 sec.");      } 

but, i'm not getting output log. mind telling me i'm doing wrong here?

from i've read, if want run when application pool started need global.asax.cs file placed in app_code folder

that's incorrect.

you add global.asax file project, has global.asax.cs code behind. through add new item dialog.

that's assuming web application of sort, it's not clear description or tags...


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -