Unrecognized attribute 'targetframework' in ASP.Net 4.5

I was  trying to up load my site and I was  getting this error message:
Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
<compilation debug="true" targetFramework="4.0">
 
The site works fine on my local pc but won't open when I loaded it to my host.

Solution

This happens basically 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 -This means it will not work even if you changed it to 2.0 in config file.

If your application is coded in 4.0 then the AppPool is need to be set up to 4.0
In IIS >  Right click on WebSite > Properties > ASP.NET > Version > "Should read 4.0.21006" not 2.0

Hope this helps

1 comment: