Web deploy error to IIS - application pool managedRuntimeVersion
Asked Answered
W

3

30

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

Wegner answered 6/6, 2011 at 12:58 Comment(0)
M
34

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

Minutia answered 25/8, 2011 at 18:36 Comment(2)
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.Riverine
Can you make the web deploy setup the correct app pool with the correct settings?Chincapin
J
7

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

Javanese answered 27/10, 2013 at 11:26 Comment(0)
E
0

I was trying to use Continuos Deployment in VSTS/TFS, in my Release Definition (which was default), I had a IIS Web App Manage Task (named Manage IISWebApplication), where it had Parent website name setting with the correct website name, and the Virtual Path setting was right as well.

I just had to fix the web site name in the Deployment Process section, where it has the Environment Name and Website name as well.

Silly, but it got me 2 days to notice the web site name was in two places in the Release Definition.

Emergence answered 19/2, 2018 at 14:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.