.NET using wrong 2.0 machine.config instead of 4.0

谁都会走 提交于 2020-01-24 09:18:21

问题


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.

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.

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


回答1:


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

  1. Navigate to server in right panel (root node)
  2. In the features list open "ISAPI and CGI Restrictions"
  3. There is 2 items with descriptions ASP.NET v4.0.30319 with restrictions set to Deny
  4. Set restrictions value to Allowed

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



来源:https://stackoverflow.com/questions/12360011/net-using-wrong-2-0-machine-config-instead-of-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!