8

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.

Community
  • 1
  • 1
PlTaylor
  • 7,345
  • 11
  • 52
  • 94
  • Dude, you gotta 1) upgrade .Net on your IIS server, and/or 2) target your build for a lower version of .Net (4.0 or, even better, 3.5 if you might need to run elsewhere). PS: .Net 4.5 is pretty bleeding edge (I just did an update to it yesterday, for some pre-release Windows 8 stuff). Are you *sure* you need 4.5??? – paulsm4 Jun 15 '12 at 20:36
  • 2
    I have already installed .Net 4.5RC on the server. Hence the statement '...to the server that has had .Net 4.5RC installed on it we get the following error'. We are testing it out on our dev server for an upcoming app that will be released after 4.5 goes RTM. – PlTaylor Jun 15 '12 at 20:39
  • What version of .net runtime is set on the AppPool? – Aleš Roubíček Jun 17 '12 at 06:41
  • Has this server had the previous betas/previews installed on it before or is it a clean install of .NET 4.5RC? – Kev Jun 19 '12 at 01:26
  • It was previously running a .NEt 4.0 site – PlTaylor Jun 19 '12 at 11:12

5 Answers5

14

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.

Community
  • 1
  • 1
dbruning
  • 5,042
  • 5
  • 34
  • 35
4

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.

PlTaylor
  • 7,345
  • 11
  • 52
  • 94
  • 1
    @PITaylor, I have the same problem with TeamCity. Can you please detail how you fixed this? – Petrus Theron Jul 04 '12 at 20:08
  • I don't have access to the server right now, but basically we changed the build runner from the .net build runner to a cmd line build runner and ran msbuild off the build box like that after we installed vs 2012 on the build box. – PlTaylor Jul 06 '12 at 15:09
1

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

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

ARYcave
  • 11
  • 1
1

I was facing the same issue even after using /P:VisualStudioVersion=11.0 as well as ignore managedruntime version in the proj file.

Run the command

C:\Windows\System32\inetsrv>appcmd set apppool /apppool.name: DefaultAppPool /managedRuntimeVersion:v4.5 

After this, reset the ISS.

Eduardo Briguenti Vieira
  • 4,351
  • 3
  • 37
  • 49
0

OK - fair enough. You need to use IIS 7.5, you need to target .Net 4.5 ... and they should be mutually compatible.

Check out this link; look for "Aspnet_regiis.exe":

http://msdn.microsoft.com/en-us/library/ee942158.aspx

'Hope that helps .. PSM

PS:

These links may (or may not) also be useful:

Please post back what you find.

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • 1
    I have registered the aspnet_regiis.exe again from the .net4.0 directory since there is no 4.5 directory. And it still doesn't seem to want to install on the server. – PlTaylor Jun 15 '12 at 21:05
  • Those links all seem to reference .Net 4.0 and don't seem to solve my problem. – PlTaylor Jun 16 '12 at 13:03