Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'."}

like image 971
carlbenson Avatar asked Nov 03 '11 15:11

carlbenson


2 Answers

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>
like image 180
Andreas Avatar answered Nov 14 '22 14:11

Andreas


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
like image 27
Rahatur Avatar answered Nov 14 '22 12:11

Rahatur