Unrecognized Attribute TargetFramework

Adding a new IIS domain as a HTTP redirect the website showed an error. When viewed as localhost this was shown as:

Parser Error Message: Unrecognized attribute 'targetFramework'.

Source Error: <compilation debug="false" strict="false" targetFramework="4.0">

The new domain was added as a redirect to a directory on an existing website, using the HTTP Redirect settings.

Initially new domain was configured to use the same directory as the existing domain. The I file was therefore available to the new website.

The targetFramework error is an old one, observed a number of times, indicating a mismatch between the IIS application pool configured for the website and the configuration made in the web.config file.

To correct the targetFramework error the I associated with the website is amended.

In IIS open up the application pool assigned to the domain.

Select Application Pools from the menu on the left and double click on the requisite application pool from the list, to open a pop-up with selections for the framework and the pipeline mode.

Select .NET Framework v4 from the list of versions available.

When testing I have found FireFox remembers the previous redirections enabled. Using Chrome I was able to make changes to the redirect, the browser acting on the new configuration.