msdeploy - Web 部署中的自动提供程序到底是什么 (msdeploy.exe)

标签 msdeploy webdeploy

有人可以解释(比 technet/msdn 文档更好)汽车供应商究竟是做什么的,它是如何工作的,以及何时使用它。

这与 Web 部署有关。我看过很多指定 -dest:auto 的文档,但对我来说并没有什么意义。

The auto provider specifies that the provider on a destination will be the same as the source provider.

Example

msdeploy.exe -verb:sync -source:appHostConfig="MySite" -dest:auto,computername=Server1

The auto provider enables you to avoid entering the full path for the -dest argument when the destination argument is the same as the -source argument. It also removes the need to copy the manifest file separately from an archive or package.

The auto provider takes the source that you specify and uses a corresponding location on the destination computer. For example, if you specify appHostConfig=Site1 as the source, the destination on the target computer will be Site1. This is useful when you want to synchronize a Web site "as is" to a remote machine.



technet docs for auto provider

没有意义的例子:
msdeploy.exe -verb:sync -source:package=myapp.zip -dest:auto

你为什么要将目的地完全设置为源?重点是什么?你不是简单地用 iteslf 来覆盖源吗?

在 VS2010 中发布包生成的 cmd 文件生成如下内容:
"C:\Program Files\IIS\Microsoft Web Deploy V2\\msdeploy.exe" -source:package='MySourcePath' -dest:auto"  

不自动意味着源会覆盖自己吗?但它没有,它实际上更新了 IIS 网站(基于 list 中的设置)

我尝试使用包作为目标,在这种情况下它确实更新了源包而不是 IIS 站点。

这个问题的催化剂是我正在实现 CI 并且我过去一直使用 msbuild/xcopy。我现在想使用 msdeploy。我想了解它,而不是简单地调用从 Visual Studio 生成的 myproject.cmd。

例如,this SO link指定对 dest 参数使用自动提供程序。

谢谢

最佳答案

我想你实际上已经为自己找到了答案。

如果源是一个包而目标是自动的,那只是意味着包中指定的组件将被“解压缩”并放置在目标服务器上。在 -source:package -dest:auto 语法中,“auto”并不意味着包本身就是目标。

而且,正如您所观察到的,如果您指定一个包作为目标,那么您为源指定的任何内容确实都会打包为一个 zip 文件,您以后可以将其用作部署到其他地方的源。

关于msdeploy - Web 部署中的自动提供程序到底是什么 (msdeploy.exe),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7097098/

相关文章:

msbuild - 使用构建服务器构建一次可行吗?

asp.net - 如何获取 Visual Studio 'Publish' 功能以包含生成后事件中的文件?

.net - Jenkins、MSBuild 和 Web 部署 : Unable to create Web Package

azure - WebDeploy 到 Azure 失败

azure - Web 部署到 Azure 失败 "Could not create SSL/TLS secure channel"

web-deployment-project - Web.config 转换变量

asp.net - Web应用程序结构和部署

azure - 在 Azure 应用服务中将 WebDeploy 端口从 8172 更改为

visual-studio - Web 部署任务失败。无法连接...服务器没有响应