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 节点,在里面粘贴以下内容即可