When I deploy my .NET application (targeting .NET framework 4.5) on IIS I am getting the following error message:
Parser Error Message: The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example,
<compilation targetFramework="4.0">
). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.
I have tried many solutions, like set the Aplication Pool to run under .NET 4, enable directory browsing, restart IIS and so on, but still receive the same error.
When I deploy the same application on another server with the same IIS setting it works fine. The IIS version on both servers are 7.5.7600.16385.
What am I missing on this server?