msbuildwebdeploymsdeploy

Using a 64-bit source and a 32-bit destination with provider appHostConfig is not supported


I am trying to do automatic deployment with MSDeploy but once I changed to using the app pool I received the following error:

Using a 64-bit source and a 32-bit destination with provider appHostConfig is not supported.

When deploying I need to specify the Application Pool Name to use. The server is 64 bit.

MSBuild

"%SOAB_MSBUILD_EXE%" "%SOAB_LOCAL_APP_PATH%\WebAPI\WebAPI.csproj" /t:Package /p:Configuration=Debug;PublishProfile=CI /p:VisualStudioVersion=16.0 /p:IncludeIisSettings=true /p:IncludeAppPool=true

MSDeploy

CALL "%SOAB_LOCAL_APP_PATH%\WebAPI\obj\Debug\Package\WebAPI.deploy.cmd" /Y "-setParam:'IIS Web Application Name'='Default Web Site\WebAPI'" "-setParam:'IIS Web Application Pool Name'='MyAppPool'"

MSBuild Path

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\msbuild.exe

Anything wrapped in %% are variables replaced at runtime by the build server.

Everything was working as expected until I tried to get the ApplicationPool to change using MSDeploy. To get the application pool to work I added the following parameters to the MSBuild command /p:IncludeIisSettings=true /p:IncludeAppPool=true and included the setParam name/value to the MSDeploy command. I cannot use the DefaultAppPool. Any help is appreciated as to what I am doing wrong, thank you in advance.

Edit: WebAPI.SetParameters.xml Parameters Declared in obj\debug\package

<?xml version="1.0" encoding="utf-8"?>
<parameters>
  <setParameter name="IIS Web Application Name" value="Default Web Site/WebAPI_deploy" />
  <setParameter name="IIS Web Application Pool Name" value="DefaultAppPool" />
  <setParameter name="IisVirtualDirectoryPhysicalPath" value="c:\_Files\MyApplication\WebAPI_deploy" />
</parameters>

Edit: Verbose Log, I dont think this adds much value but maybe it will help someone who has more experience with MSDeploy.

-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='c:\_Files\MyApplication\WebAPI\obj\Debug\Package\WebAPI.zip' -dest:auto,includeAcls="False" -verb:sync -enableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"c:\_Files\MyApplication\WebAPI\obj\Debug\Package\WebAPI.SetParameters.xml" -setParam:'IIS Web Application Name'='Default Web Site\WebAPI' -setParam:'IIS Web Application Pool Name'='MyAppPool' -verbose
Verbose: Performing synchronization pass #1.
Verbose: Parameter entry 'IIS Web Application Name/1' is applicable to 'appHostConfig/Default Web Site/WebAPI' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'contentPath/c:\_Files\MyApplication\WebAPI\obj\Debug\Package\PackageTmp' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/3' could not be applied anywhere.
Verbose: Parameter entry 'IIS Web Application Name/1' is applicable to 'appHostConfig/Default Web Site/WebAPI' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'contentPath/c:\_Files\MyApplication\WebAPI\obj\Debug\Package\PackageTmp' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/3' could not be applied anywhere.
Verbose: Parameter entry 'IIS Web Application Name/1' is applicable to 'appHostConfig/Default Web Site/WebAPI' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'contentPath/c:\_Files\MyApplication\WebAPI\obj\Debug\Package\PackageTmp' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/3' could not be applied anywhere.
Verbose: No backup was executed.
Verbose: Parameter entry 'IIS Web Application Name/1' is applicable to 'appHostConfig/Default Web Site/WebAPI' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'contentPath/c:\_Files\MyApplication\WebAPI\obj\Debug\Package\PackageTmp' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/3' could not be applied anywhere.
Info: Adding sitemanifest (sitemanifest).
Verbose: Parameter entry 'IIS Web Application Name/1' is applicable to 'appHostConfig/Default Web Site/WebAPI' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'contentPath/c:\_Files\MyApplication\WebAPI\obj\Debug\Package\PackageTmp' because of its scope.
Verbose: Parameter entry 'IIS Web Application Name/3' could not be applied anywhere.
ERROR: Error: Using a 64-bit source and a 32-bit destination with provider appHostConfig is not supported.
ERROR: Error count: 1.

Solution

  • Before the original post I tried uninstalling Web Deploy, and installing the 64 bit version. For some reason installing the 64 bit version of Web Deploy also installed the 32 bit version. My team had multiple versions installed on the server. I finally removed all registry entries, and completely removed everything related to Web Deploy including the services. I reinstalled the 64 bit version of Web Deploy (Complete Install with Services), and received the same error message. I checked both 'Program Files' & 'Program Files x86' and saw Web Deploy in both. I switched from using WebAPI.deploy.cmd to MSDeploy.exe directly. The reason why is because the WebAPI.deploy.cmd file was still using the 32 bit version of Web Deploy. By changing to using MSDeploy.exe directly, I was able to control which version 32 or 64 bit. I received a new error, and resolved it. All I need now is to insert the password for the app pool identity.