问题
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):
- Navigate to server in right panel (root node)
- In the features list open "ISAPI and CGI Restrictions"
- There is 2 items with descriptions ASP.NET v4.0.30319 with restrictions set to Deny
- 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