Update
Disregard my comments below. While it got me past the deploy, I got a 503 Service Unavailable
when I actually tried to run the web app. I backed out this change by setting the managedRuntimeVersion
property back to v4.0 and added the IgnoreDeployManagedRuntimeVersion
to my project. Then the deploy succeeded and the app worked. Dumb...
This happened to me after I installed .NET Framework 4.5.1 on a Windows Server 2008 R2 SP1 machine (as part of upgrading Powershell).
The IIS user interface on Windows Server 2008 doesn't give the option of setting the managedRuntimeVersion
property to v4.5 even after that version is installed. However, this can be done on the command line using the appcmd
utility as @3boysdad's answer shows.
appcmd
is the command-line equivalent of managing IIS sites, apps, apppools, etc. It is located at %systemroot%\system32\inetsrv\appcmd.exe
but it is not on the PATH as the following link explains:
http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe#HowToUse
I'm of the opinion that modifying your project (via the IgnoreDeployManagedRuntimeVersion
or DeployManagedRuntimeVersion
properties) is sub-optimal. The application pool should be set to use v4.5, and the only way to do that on Windows Server 2008 is to use the appcmd
utility. @3boysdad's answer should be the accepted answer.