carlbenson
carlbenson

Reputation: 3207

The type initializer for 'Quartz.Impl.StdSchedulerFactory' threw an exception

I'm following the directions on Quartz.Net's tutorial pretty closely, but I'm getting a start error when trying to debug my project.

 The type initializer for 'Quartz.Impl.StdSchedulerFactory' threw an exception.

I couldn't really find any help online. Is this a configuration problem? Anybody know where I can get a straightforward list of what needs to be configured?

(I'm using Quartz.Net 2.0)

INNER EXCEPTION: {"Failed obtaining configuration for Common.Logging from configuration section 'common/logging'."}

Upvotes: 5

Views: 9544

Answers (3)

Md Rahatur Rahman
Md Rahatur Rahman

Reputation: 3244

In my case it was the version of the Quartz.net.

Initially I used the latest version of Quartz.net and had the same error. Now I am using:

  • Common.Logging 2.1.2.0
  • Common.Logging.Log4Net1211 2.1.0.0
  • log4net 1.2.11.0
  • Quartz 2.2.2.400

Upvotes: 2

Răzvan Flavius Panda
Răzvan Flavius Panda

Reputation: 22106

Check that you have added a reference to Common.Logging.Log4Net dll in your solution.

If not you can find a compatible Common.Logging.Log4Net dll in Quartz.NET-2.0.1\lib\2.0:

Download Quartz.NET-2.0.1.zip (9.7 MB)

Also you might need to use log4net version 1.2.10.0.

Upvotes: 0

Andreas
Andreas

Reputation: 5309

You most likely do not reference all required assemblies e.g. "Common.Logging.dll".

Update

The constructor fails because your app.config or web.config does not contain a section for common\logging. Does your .config file contains the following section:

  <configSections>
    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
    </sectionGroup>
  </configSections>
  <common>
    <logging>
      <factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
        <arg key="level" value="DEBUG" />
        <arg key="showLogName" value="true" />
        <arg key="showDataTime" value="true" />
        <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
      </factoryAdapter>
    </logging>
  </common>

Upvotes: 4

Related Questions