Web deploy error to IIS - application pool managedRuntimeVersion

John picture John · Jun 6, 2011 · Viewed 28.3k times · Source

When trying to deploy an ASP.NET application deployment package to IIS, I receive an error

(The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v2.0'. This application requires 'v4.0'.

I have taken these steps:

  • ensured my server's default .NET Framework version is 4 (restarted the IIS service on the machine)
  • ensured my web application is set for .NET 4
  • ensured the application's web.config has no references to requiring .NET 2 or 3.5

What is the root cause of this error, and how can it be solved?

enter image description here

enter image description here

Answer

Andrey Morozov picture Andrey Morozov · Aug 25, 2011

Web Deploy uses the default IIS web site settings while publishing. To change/confirm this on your IIS machine:

  • go to IIS->Default Web Site->Basic Settings->Application Pool
  • select ASP.NET v4.0 or the appropriate app pool using the appropriate Framework version

If you're trying to import this application into an existing site, ensure that its application pool is the same version. I was attempting the same, but didn't realize my 'new' website was running on an app pool that was v2.

Be sure that your Application Pools by default are configured also for v4.0 by default.

enter image description here

enter image description here