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


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..”


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


That should be it 🙂