ASP.NET 4.0 application error: Unrecognized attribute 'targetFramework'

Programming, error messages and sample code > ASP.NET
You may experience the following error when you attempt to open your web application:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

The error indicates that your account is configured to run with the ASP.NET 2.0 framework, but your application is an ASP.NET 4.0 application.

To solve the problem, you can go to Control Panel, navigate to "IIS manager" on the left hand, click ".net Application", click "change" icon to choose ASP.NET 4.0 and proper mode, and apply.