MSDeploy batch file does not handle quotes anymore

空扰寡人 提交于 2019-11-30 06:41:56

This is a bug introduced in the SP1 release. You can work around it by editing %ProgramFiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (note 64-bit path). Change lines 3238-3258 to match the respective contents in the old deploy.cmd file; the diff should only be like 3 lines, removing _ArgCurrentOriginal and using _ArgCurrent.

There's also a KB recently published on the issue: http://support.microsoft.com/kb/2537134. This includes an updated .targets file so you don't have to make the edit yourself.

I was able to work around this issue by surrounding the whole argument in quotes and the inner argument in single quotes, ie:

.\Deploy.cmd /y 
  /m:https://SERVER:8172/msdeploy.axd 
  -allowUntrusted 
  "-postSync:runCommand='echo hello'"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!