【问题标题】:msdeploy + setParameters.xml, how to set web physical file locationmsdeploy + setParameters.xml,如何设置web物理文件位置
【发布时间】:2012-09-11 22:38:59
【问题描述】:

这个问题有点绕,如果是重复的,请原谅我,但我还没有找到确切的答案。

我正在尝试为部署配置创建一个Parameters.xml,用于指定网站的目标物理文件夹。这是用于使用 TeamCity 的自动构建,例如使用 .deploy.cmd 的命令行。

谁能解释我需要做什么?

Parameters.xml:

<parameter name="physicalPathLocation" description="Physical path where files for this Web service will be deployed." defaultValue="\" tags="PhysicalPath">
    <parameterEntry kind="DestinationVirtualDirectory" scope="Default\ Web\ Site/iag\.application\.services\.exampleservice/" match="" />
</parameter>

在 SetParameters.xml 中

<setParameter name="physicalPathLocation" value="C:\MyFolder\MySite" />

我怀疑我的问题在于我如何声明范围,但不确定需要做什么。

【问题讨论】:

  • 我相信它可能是“physicalPath”而不是“physicalPathLocation”,但这没有很好的记录。
  • @WhatWouldBeCool - “physicalPathLocation”是 Stu 任意命名的参数。参数种类确实是DestinationVirtualDirectory

标签: file path location msdeploy


【解决方案1】:

假设 Default Web Site/iag.application.services.exampleservice 是 IIS 中的虚拟目录(DestinationVirtualDirectory 仅对“应用程序”有效),您可能只需删除 / 后缀而不对其进行编码即可。 (我还删除了match 属性)

<parameter name="physicalPathLocation" 
           description="Physical path where files for this Web service will be deployed." 
           defaultValue="\" 
           tags="PhysicalPath"
           >
    <parameterEntry kind="DestinationVirtualDirectory" 
                    scope="Default Web Site/iag.application.services.exampleservice" />
</parameter>

请记住,您不必必须在设置参数之前声明参数。您可以轻松地声明完整参数并同时设置它:

<setParameter name="physicalPathLocation" 
              kind="DestinationVirtualDirectory" 
              scope="Default Web Site/iag.application.services.exampleservice" 
              value="C:\MyFolder\MySite" />

【讨论】:

  • scope="/" 用于移动使用 appHostConfig 导出的站点根目录。
猜你喜欢
  • 2017-05-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-10-06
  • 2012-02-06
  • 1970-01-01
  • 1970-01-01
  • 2011-02-01
相关资源
最近更新 更多