Web deploy error to IIS - application pool managedRuntimeVersion

29,160

Solution 1

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

Solution 2

ASP.NET 4 is installed when you install Visual Studio. However, the installation process does not automatically register ASP.NET 4 with IIS, and existing IIS Web sites are not automatically assigned to.NET 4 application pools.

To fix this, register ASP.NET with IIS and set the application pool of the destination IIS Web site to the .NET Framework version that is required by the package.

To do this, open Command Prompt as administrator and go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and type: aspnet_regiis -i

According to Web Deployment FAQ for Visual Studio and ASP.NET

Share:
29,160
Admin
Author by

Admin

Updated on July 10, 2022

Comments

  • Admin
    Admin almost 2 years

    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

  • NightOwl888
    NightOwl888 over 11 years
    This led me to the solution, but it should be noted here that the configuration must be done to the destination machine, not the source.
  • Martin Clemens Bloch
    Martin Clemens Bloch about 11 years
    Can you make the web deploy setup the correct app pool with the correct settings?