简体   繁体   English

无法读取配置节“ serviceAutoStartProviders”,因为它缺少节声明

[英]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.

相关问题 无法读取配置节&#39;entityFramework&#39;,因为它缺少节声明 - The configuration section 'entityFramework' cannot be read because it is missing a section declaration 配置部分&#39;services&#39;无法读取,因为它缺少部分声明 - the configuration section 'services' cannot be read because it is missing a section declaration 无法读取配置节'customErrors',因为它缺少节声明 - The configuration section 'customErrors' cannot be read because it is missing a section declaration 无法读取配置节&#39;connectionStrings&#39;,因为它缺少节声明 - The configuration section 'connectionStrings' cannot be read because it is missing a section declaration 无法读取配置节&#39;configsections&#39;,因为它缺少节声明 - The configuration section 'configsections' cannot be read because it is missing a section declaration 无法读取配置节&#39;程序集&#39;,因为它缺少节声明 - The configuration section 'assemblies' cannot be read because it is missing a section declaration 无法读取配置节&#39;system.web.webPages.razor&#39;,因为它缺少节声明 - The configuration section 'system.web.webPages.razor' cannot be read because it is missing a section declaration 无法读取配置节“ system.ServiceModel”,缺少节声明 - The configuration section 'system.ServiceModel' cannot be read, missing section declaration 配置部分&#39;log4net&#39;缺少部分声明 - Configuration section 'log4net' is missing a section declaration 配置部分“appSettings”有一个意外声明 - The configuration section 'appSettings' has an unexpected declaration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM