Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying a .Net 4.5 website to an IIS 7.5 server

We are using Teamcity to do continuous integration builds for our website and have just upgraded our website to .Net 4.5RC. The application builds and runs in IIS express on my box and builds on our build server that I have installed .NEt 4.5RC on. But when we deploy it to the server that has had .Net 4.5RC installed on it we get the following error.

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

What can I do to fix this problem. I have tried setting the application pool on the server to 4.5, but can't. See this SO post.

like image 200
PlTaylor Avatar asked Jun 15 '12 20:06

PlTaylor


People also ask

What version of .NET does IIS use?

NET Framework 4.5 is the default . NET Framework for use by Windows Server 2012, the "DefaultAppPool" on IIS 8.0 also defaults to using the newer version of the . NET Framework.

Is .NET required for IIS?

IIS works with ASP.NET Core.


3 Answers

I had a similar problem. I was building my application by calling MSBuild, and I found that when I tried to web-deploy the application I got that error. I fixed it by telling MSBuild to build with VS2012, by adding a commandline switch to the MSBuild command:

/P:VisualStudioVersion=11.0

Tip o' the hat to this question.

like image 73
dbruning Avatar answered Oct 03 '22 22:10

dbruning


It turns out that it is a TeamCity problem. When we push the update directly to the site from Visual Studio 2012 RC it works fine. We have had to change the build runner in TeamCity to a command line runner that calls the WebDeploy 3.0 of VS 2012.

like image 44
PlTaylor Avatar answered Oct 03 '22 23:10

PlTaylor


origin: http://forums.iis.net/t/1164093.aspx/1

says: "double click on application pool and then changed .Net Framework Version"

like image 31
ARYcave Avatar answered Oct 03 '22 23:10

ARYcave