您的位置:首页 > 其它

<configSections> 位置引起的错误

2015-02-02 14:03 295 查看
今天在配置一个项目的时候,花了挺长时间配置完成,然后一启动项目,懵了,启动报错:错误显示

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element.

Unrecognized configuration section loggingProvider

最后纠结了半天,查了很多错误原因,因为没有直接搜索configSections错误,而是直接查询的错误,导致很长时间没有查出真正的原因,最后拿了别的web.config进行对比发现<configSections>的位置是靠在最前面的。调整好了,再运行,成功了。后来在网上查询说,<configSections>节点前不允许有其它节点。所以当我把它放在中间的时候则报上面的错误。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐