MSBuild deploy failing after upgrade to .NET 4.5

后端 未结 5 1406
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 16:32

We recently upgraded our VS 2010 and .NET 4 application to VS 2012 and .NET 4.5. We have a build script to deploy the application on the test server. We have two boxes - one

5条回答
  •  独厮守ぢ
    2020-12-07 17:13

    I observed that when I use VS2012 Publish Web Deploy Package feature, it generates a .zip file. Inside that zip there is a file called archive.xml that contains a createApp tag with the attribute 'managedRuntimeVersion="v4.0"' . When I use msdeploy.exe to sync it to an iis instance, it works.

    However, when I use msbuild.exe to create a web package .zip file, it contains an archive.xml that has 'managedRuntimeVersion="v4.5"'. Trying to deploy this web package to IIS using msdeploy.exe results in the ERROR_APPPOOL_VERSION_MISMATCH error.

    As Sayed Ibrahim Hashimi explained here, adding "/p:VisualStudioVersion=11.0" to my msbuild.exe command line effectively forces 'managedRuntimeVersion="v4.0"' in the archive.xml of the resulting web package so it resolves the issue.

提交回复
热议问题