Unrecognized Attribute targetFramework Occurs When Running a Published Web Application

If you publish a presentation project to your local IIS for testing, you might encounter the following error when you attempt to access the application via a web browser:

Configuration Error

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.

This error occurs if your presentation project is configured to use .Net 4.0 or later, but IIS is configured to use an earlier version of the .Net framework.

To resolve this problem, make sure you have properly configured IIS for .Net 4.0 or later. See the heading Configure IIS in the section Publishing to IIS for instructions on configuring IIS. After you have configured IIS properly, publish the application again.