0

我在 web.config MVC Web 项目中添加了自定义配置部分,它工作正常。我在 Windows 服务项目下的 app.config 中做了同样的事情,它抛出了错误。

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

但是在删除自定义配置部分时,它可以正常工作而没有错误。

<configSections>
<section name="RegisterSchedule" type="Sample.Common.CustomConfig.RegisterScheduleConfig, Sample.Common.CustomConfig" />

  <RegisterSchedule>
    <Schedules>
      <Schedule Name="TestSchedule1" Value="test" IsEnabled="true" />
      <Schedule Name="TestSchedule2" Value="123" IsEnabled="true" />
    </Schedules>
 </RegisterSchedule>
4

1 回答 1

2

当我移动<configSections>app.config旁边的顶部时,它起作用了configuration

于 2013-05-24T12:31:29.697 回答