Solution: Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive.

Issue:

I was using Visual Studio 2012 and was writing a Web App using .NET 4.5 so in my web.config I had:

<compilation debug="true" targetFramework="4.5">

However every time I run my app, I was getting an error “Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive.”

This is caused by the IIS running an older version of ASP.NET

Solution to fix on local dev box:

  • Click on “Website” tab in the top menu
  • Select “Start Options..”

Website-StartOptions

  • From the pop-up window, on the left menu select “Build”
  • Choose your .NET framework desired
  • Click OK/Apply

.NET_framework

That should be it 🙂