如果有引号,MS 从部署对话框(不是 powershell)进行部署将不起作用
在我的 Visual Studio 2010 SP1Rel 中,MS Web 部署突然停止工作并出现以下错误:
Unrecognized argument 'Web'. All arguments must begin with "-".
参数“Web”引用参数“默认网站”,即如果路径包含空格,Web 部署将无法部署。这一直有效到今天。
如果我将网站重命名为 DefaultWebSite(无空格),则错误消息将更改为:
Unrecognized argument 'Source=10.10.10.1\MSSQLSERVER,1432;Initial'.
All arguments must begin with "-".
还有其他关于同一错误的问题,但情况不同。我正在使用内置的网络部署对话框。
同样的错误,但对于批处理脚本: MSDeploy 批处理文件不处理引号不再 同样的错误,但在 powershell 中:如何当参数有空格时,你会从powershell调用msdeploy吗?
这些问题与安装VS 2010 SP1有关。我没有安装SP1。它可能已自动安装在 Windows 更新中。
使用 MS 部署对话框(右键单击 VS 中的项目并单击“部署”)时如何解决此错误?
In my Visual Studio 2010 SP1Rel, MS web deploy has suddenly stopped workingwith this error:
Unrecognized argument 'Web'. All arguments must begin with "-".
The argument "Web" refers to the parameter "Default Web Site", ie web deploy cannot deploy if the path contains spaces. This worked until today.
If I rename my website to DefaultWebSite (no spaces) then the error message changes to:
Unrecognized argument 'Source=10.10.10.1\MSSQLSERVER,1432;Initial'.
All arguments must begin with "-".
There are other questions about the same error but the circumstances are different. I am using the built in web deploy dialog.
Same error, but for a batch script: MSDeploy batch file does not handle quotes anymore
Same error, but in powershell: How do you call msdeploy from powershell when the parameters have spaces?
These questions are related to installing VS 2010 SP1. I did not install SP1. It might have been automatically installed in a windows update.
How do I solve this error when using the MS deploy dialog (right click the project in VS and click Deploy)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 UseMSDeployExe 标志工作方式中的一个错误;它为 WebDeploy 生成一组无效的命令行参数。尝试从 wpp.targets 文件中删除该行,它应该可以正常工作。此错误将在未来版本中修复。
旁注:UseMSDeployExe 主要用作 VS 团队调试 WebDeploy 问题的测试挂钩。 VS 有 2 种独立的模式:在进程内使用 WebDeploy(我认为是通过反射),以及在进程外通过 shell 到 msdeploy.exe(因此有 UseMSDeployExe 标志)。设置 UseMSDeployExe 没有真正的好处,除非您正在查找 VS 传递给 WebDeploy 的命令参数。
This was a bug in the way the UseMSDeployExe flag works; it's generating an invalid set of command line parameters for WebDeploy. Try removing that line from your wpp.targets file, and it should work correctly. This bug will be fixed in a future release.
Side note: UseMSDeployExe is mainly intended as a test hook for the VS team to debug issues with WebDeploy. VS has 2 separate modes: In-proc usage of WebDeploy (via reflection I think), and Out-of-proc by shelling out to msdeploy.exe (hence the UseMSDeployExe flag). There's no real benefit to setting UseMSDeployExe, unless you're looking for the command arguments VS is passing to WebDeploy.