Web.config文件里面加入

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

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

解决方法:

找到目录:C:\Windows\Microsoft.NET\Framework\v1.1.4322\CONFIG 下面的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项目都要在代码里面配置了

posted on 2019-10-12 11:17  红磨坊后的白桦树  阅读(594)  评论(0编辑  收藏  举报