[英]The configuration section 'serviceAutoStartProviders' cannot be read because it is missing a section declaration
I am working on Hangfire, I want to use "serviceAutoStartProviders" in web.config for auto start. 我正在使用Hangfire,我想使用web.config中的“ serviceAutoStartProviders”来自动启动。 But where should I define "serviceAutoStartProviders" in web.config?
但是我应该在web.config的哪里定义“ serviceAutoStartProviders”?
I got an error message of: 我收到以下错误消息:
The configuration section 'serviceAutoStartProviders' cannot be read because it is missing a section declaration
无法读取配置节“ serviceAutoStartProviders”,因为它缺少节声明
My code is as below in web.configration: 我的代码如下在web.configration中:
<system.web>
<serviceAutoStartProviders>
<add name="ApplicationPreload" type="WebApplication1.ApplicationPreload, WebApplication1" />
</serviceAutoStartProviders>
</system.web>
This should be defined inside a system.applicationHost
element. 这应该在
system.applicationHost
元素内定义。 If you take a look at the docs , you can see this from the doc structure (and even the URL path used) though I admit it's not particularly clear. 如果您看一下docs ,则可以从doc结构(甚至使用的URL路径)中看到它,尽管我承认这并不是特别清楚。 For example:
例如:
<system.applicationHost>
<serviceAutoStartProviders>
<add name="ApplicationPreload" type="...." />
</serviceAutoStartProviders>
</system.applicationHost>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.