使用.NET错误2.0的machine.config而不是4.0而不是、错误、NET、config

2023-09-04 13:42:30 作者:﹌ 吃心不改

我有一个.NET Web应用程序安装在IIS 7.0的Windows Server 2008 R1。我已经在服务器上安装.NET 4.0和4.0及综合管线配置的应用程序池。出于某种原因,我收到以下错误:

I have a .NET web application install on IIS 7.0 Windows Server 2008 R1. I have installed .NET 4.0 on the server and configured an app pool for 4.0 and integrated pipeline. For some reason I am getting the following error:

(500.19) The configuration section 'system.web.extensions' cannot be read because
  it is missing a section declaration.

看来,它使用的是2.0版的.NET,而不是 machine.config的已定义的 System.Web.Extensions程序配置部分文件。我通过更换 machine.config的文件中的V2.0框架与一个来自V4.0框架和Web应用程序证明了这不再抛出的 500.19 错误。我试图卸载并重新安装.NET 4.0以及运行为aspnet_regiis -i

It appears that it is using the wrong machine.config file from V2.0 .NET rather than the machine.config file which has defined the system.web.extensions config section. I proved this by replacing the machine.config file in the V2.0 framework with the one from the V4.0 framework and the web application no longer throws the 500.19 error. I have tried to uninstall and reinstall .NET 4.0 as well as running aspnet_regiis -i.

这是为什么它会试图使用任何思想的2.0 machine.config的

Any thoughts on why it would be trying to using the 2.0 machine.config?

推荐答案

不知道,这是真的原因/解决方案,但最后一件事,我尝试它(在IIS管理器):

Not sure, that it's realy reason/solution, but last thing I've try it is (in IIS Manager):

导航到右边的面板服务器(根节点) 在功能列表中打开ISAPI和CGI限制 有一个与设置为拒绝限制,2项带有介绍ASP.NET v4.0.30319 设置的限制值,以允许

这是我已经尝试过的问题没有了过去的事情。

This is last thing i've tried before issue is gone.