无法识别的配置节 system.webServer

 Web.config文件里面加入

<configSections>
<section name="system.webServer" type="System.Configuration.IgnoreSectionHandler,System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

 不想每次代码里面配置就如下操作

解决方法:

找到目录:C:WindowsMicrosoft.NETFrameworkv1.1.4322CONFIG 下面的machine.config文件,修改文件内容找到 configSection 节点,在里面粘贴以下内容即可
<section name="system.webServer" type="System.Configuration.IgnoreSectionHandler,System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

加在 </configSections> 结束前即可。

v1.1.4322如果没有那就在找一下其他的Framework下的machine.config文件,看一下有没有system.webServer,没有就加进去,这样就不用每次原因web项目都要在代码里面配置了

原文地址:https://www.cnblogs.com/macT/p/11660400.html