Today I was trying to publish a Asp.net 4.5 site to our server and I received 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’
I thought this was odd so I went to change the App pool, only to see there is no v4.5 option. After a bit of Goggling my suspicions about v4.5 not having an app pool as v4.5 of .net is inplace update and does not have a new ‘version’.
After a bit more Goggling and looking at StackoverFlow answers I found the solution, although it was not the ‘selected’ solution but oh well.
See I am doing my deploy via a powershell script using pSake and my deploy looked something like this
&$msBuildpath /verbosity:m $projectFileAndPath /T:Rebuild /T:Package /p:"Configuration=$buildMode;Packagelocation=$packageFolder"
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=RemoteAgent /p:MSDeployServiceUrl=$deploymentServer /p:DeployIisAppPath=$deploymentAppPath
What I needed to add was the
/P:VisualStudioVersion=11.0 switch to force the right compiler. Once I added this switch my deploy was right as rain.
Till next time,
12-18-2012 8:28 AM