【问题标题】:Custom Config Section in app.config in Windows ServiceWindows 服务中 app.config 中的自定义配置部分
【发布时间】:2013-05-19 22:44:12
【问题描述】:

我在 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>

【问题讨论】:

  • 内部异常和堆栈跟踪是什么。如果您对此进行分析,您可以对这个问题有很多有意义的见解。

标签: c# windows-services app-config


【解决方案1】:

当我将 &lt;configSections&gt; 移动到 app.config 的顶部 configuration 旁边时,它起作用了。

【讨论】:

    猜你喜欢
    • 2012-10-04
    • 2011-10-02
    • 1970-01-01
    • 2015-07-05
    • 2011-05-25
    • 2011-11-04
    • 1970-01-01
    • 2011-12-10
    • 1970-01-01
    相关资源
    最近更新 更多