Note that there are some explanatory texts on larger screens.

plurals
  1. POType initializer for Quartz.net throws an exception
    primarykey
    data
    text
    <p>I'm taking a look at Quartz.NET 2.0 beta 1.</p> <p>I'm using the first example code, in my own project, my code is:</p> <pre><code>class Program { static void Main(string[] args) { // First we must get a reference to a scheduler ISchedulerFactory sf = new StdSchedulerFactory(); IScheduler sched = sf.GetScheduler(); // computer a time that is on the next round minute DateTimeOffset runTime = DateBuilder.EvenMinuteDate(DateTimeOffset.UtcNow); // define the job and tie it to our HelloJob class IJobDetail job = JobBuilder.Create&lt;HelloJob&gt;() .WithIdentity("job1", "group1") .Build(); // Trigger the job to run on the next round minute ITrigger trigger = TriggerBuilder.Create() .WithIdentity("trigger1", "group1") .StartAt(runTime) .Build(); // Tell quartz to schedule the job using our trigger sched.ScheduleJob(job, trigger); Console.WriteLine(string.Format("{0} will run at: {1}", job.Key, runTime.ToString("r"))); // Start up the scheduler (nothing can actually run until the // scheduler has been started) sched.Start(); // wait long enough so that the scheduler as an opportunity to run the job! // wait 65 seconds to show jobs Thread.Sleep(TimeSpan.FromSeconds(65)); // shut down the scheduler sched.Shutdown(true); } } /// &lt;summary&gt; /// This is just a simple job that says "Hello" to the world. /// &lt;/summary&gt; /// &lt;author&gt;Bill Kratzer&lt;/author&gt; /// &lt;author&gt;Marko Lahma (.NET)&lt;/author&gt; public class HelloJob : IJob { /// &lt;summary&gt; /// Empty constructor for job initilization /// &lt;para&gt; /// Quartz requires a public empty constructor so that the /// scheduler can instantiate the class whenever it needs. /// &lt;/para&gt; /// &lt;/summary&gt; public HelloJob() { } /// &lt;summary&gt; /// Called by the &lt;see cref="IScheduler" /&gt; when a /// &lt;see cref="ITrigger" /&gt; fires that is associated with /// the &lt;see cref="IJob" /&gt;. /// &lt;/summary&gt; public virtual void Execute(IJobExecutionContext context) { // Say Hello to the World and display the date/time Console.WriteLine(string.Format("Hello World! - {0}", System.DateTime.Now.ToString("r"))); } } </code></pre> <p>I can compile this code after many failure tests with .Net framework Client Profile...</p> <p>But when it runs, code on first line throws:</p> <blockquote> <p>The type initializer for 'Quartz.Impl.StdSchedulerFactory' threw an exception.</p> </blockquote> <p>I can not find anything about this, has anyone got some ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload