Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

This typically happens when you have an attribute of targetFramework="4.0" in the web.config but the App Pool is set to run ASP.NET 2.0. The targetFramework attribute is entirely unrecognized by ASP.NET 2.0 - so changing it to 2.0 won't have the desired effect.

Contact Support / Your Administrator and have the AppPool switched to 4.0.

You could also remove the attribute entirely, however if your site was coded with the 4.0 Framework, then I'm sure something else will cause an error as well.


Registering the framework with IIS is what worked for me:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i

In IIS

Click on Application Pools

Right Click on DefaultAppPool --->> Set Application Pool Default....--->>Change .Net Version to V 4.0.


open your IIS (type inetmgr in run) and change your Application pool setting,To view large this Image Right Click Image and open image in new tab enter image description here