I'm having an issue with msdeploy not syncing application pool information for a sub application of a site (Default Web Site for example).
Essentially I was hoping I could create webdeploy/msdeploy packages as part of a nightly build process of multiple development branches and then deploy these branch-specific packages to a server for smoke testing. All seems plausible but unfortunately I cannot find a way to set the app pool that the deployed package's iisApp is intended to use. I can create and deploy packages that contain appPoolConfig providers to support the creation of the app pool itself but this is useless if I cannot set the app pool on the application I'm deploying.
By the way, I feel like I'm almost reiterating other questions that appear to be similar. Various answers are given for using appPoolconfig or appPoolExtension but I've had no luck with these. From my reading appPoolConfig is used to sync app pools themselves not the app pool "assigned" to an application. Incidentally, this type of sync operation works well. And as for appPoolExtension I'm at a loss as to what it actually does when it is switched on as I see no difference in the generated package.
I can recreate the problem using a simple set of steps that uses msdeploy only with no WPP/webdeploy/msbuild in the way with the intention that it should work with the lowest level tool alone:
Windows 8 (note: I can replicate the issue on Win 2008 R2 also), IIS and Web Deploy 3.0 installed.
- Assuming a Default Web Site exists and .NET 4.0 is installed, create a new application pool called TestPool.
- Create a new application called TestApp under Default Web Site and assign its application pool to the TestPool created in step 1.
- Open command prompt with path access to msdeploy.
Type >
msdeploy -verb:sync -source:iisApp="Default Web Site/TestApp" -dest:package=c:\temp\testapp.zip,encryptPassword="password" -enableLink:AppPoolExtension- Now that we have a package we can delete TestApp from under the Default Web Site and delete any remaining physical folder created as part of the initiall application creation.
Assuming we still have the TestPool application pool configured in IIS as an available pool, type >
msdeploy -verb:sync -source:c:\temp\testapp.zip,encryptPassword="password" -dest:iisApp="Default Web Site/TestApp" -enableLink:AppPoolExtension- Go to IIS Manager and select our TestApp under Default Web Site. Click Basic Settings... and the Application Pool is not the required TestPool but instead is the default pool set for the Default Web Site.
Any help is appreciated.
EDIT: Just ran a variation on the steps above and change the "iisApp" to "appHostConfig" in both msdeploy command lines and the app pool settings are retained so a success from an msdeploy point of view. However, if this is the solution, how does one inform the VS 2012 publish process to use appHostConfig rather than issApp?
EDIT: In answer to my own edit this answer worked: https://stackoverflow.com/a/12741525/739097. This begs another question though about how one can integrate the package creation on a build server with no IIS but my thoughts here are that one would create a template package first based upon the required IIS settings, dynamic parameters, etc but essentially empty of content. The build process would then create a package of content only and sync this with the template package to create a final package for deployment.