Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET using wrong 2.0 machine.config instead of 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.

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?

like image 756
user1661270 Avatar asked Dec 19 '25 15:12

user1661270


1 Answers

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.

like image 180
Kiryl Avatar answered Dec 21 '25 08:12

Kiryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!