MSDeploy fails to deploy manually zipped package

时间秒杀一切 提交于 2019-12-05 06:47:50

I had this exact problem. I've got a bunch of msdeploy packages and need to update some of the files post-packaging but pre-deploy.

If I use msdeploy sync to extract the packages, the parameters get processed - that's no good, they're just placeholders until I know which environment is being targeted. So I need to unzip the package and then make the changes...so far so good.

But then I rezip it all up. And then then I get this issue: msdeploy won't process the contained folders. If I use msdeploy to process the extracted files, again I lose the parameters...or rather they get processed prematurely from the paramters.xml file. Grr.

The solution? Use 7zip...or anything apart from standard Windows zipper.

e.g. 7z.exe a -r C:\deploys\mypackage.zip C:\extractedstuff\*

Don't use zip archiver. You must call msdeploy.exe.

bat-file example :

msdeploy.exe -verb:sync ^
-source:archiveDir="C:\YourAbsolutePathToTheFolderContaining_Content_DirAnd_XMLs" ^
-dest:package="ArchName.zip" ^
-declareParam:name="IIS Web Application Name",defaultValue="Default Web Site/AppName",tags="IisApp" ^
-declareParam:name="IIS Web Application Name",type="ProviderPath",scope="IisApp",match="^.*PackageTmp$" ^
-declareParam:name="IIS Web Application Name",type="ProviderPath",scope="setAcl",match="^.*PackageTmp$"

For more info look at help:

msdeploy -help -dest
msdeploy -help -declareParam

and other. Also, see parameters.xml

Dan Kendall's answer helped me but in the end I didn't need to use 7Zip. I prefer this way because then I don't need to install 7Zip on the build server.

The answer was simple, I just switched from using Zip to Archive Files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!