.NET error: Unrecognized attribute ‘targetFramework’ on IIS6
I recently had to move a .NET application directory to a new location on an IIS 6 server. When I did, of course everything broke. Among the errors that had to be fixed was this one:
Unrecognized attribute 'targetFramework'.
This is usually because the application pool is not set to use the framework assigned to the application in IIS Manager.
There are several ways to fix this. I chose the easiest one: setting the application extension path to the correct executable.
Thanks to “jambot” on the .NET forums for this list of steps
Make sure the correct .NET framework is installed on the server
Under “web service extensions in IIS 6, the correct version of .NET must be added and allowed.
In IIS Manager, create a new application pool for .NET 4.
In IIS Manager, right click on the application’s virtual directory and select the .NET 4 application pool.
Click configuration and go to the mappings tab.
Set the path to the correct .NET executable for the extensions you want to use. (e.g. C:winntmicrosoft.netframeworkv4.0.30319aspnet_isapi.dll)