When I deploy my mvc application to my IIS 7 server it has the following in the web.config file:
<system.web>
<compilation targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
Having the compilation & httpRuntime tags in give me the following error:
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, ''). 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.
So just for giggles I removed the compilation & httpRuntime tags and then the sites works perfectly! The server has 4.5.1 on it. I'm guessing this is something about the application pool, but it looks like the only options in the application pool are: No Managed Code, .NET Framework v2.0, .Net Framework v4.0. There isn't an option for v4.5 or v4.5.1. Right now it's set to v4.0.
I didn't really understand what compilation and httpRuntime are used for and why they are even in my web.config as I didn't explicitly place them there.