msdeploy + setParameters.xml,如何设置web物理文件位置

时间:2012-09-11 22:39:00

标签: file path location msdeploy

这个问题已经跳了一下,请原谅我是否重复,但我找不到确切的答案。

我正在尝试为部署配置创建一个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" />

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

1 个答案:

答案 0 :(得分:3)

假设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" />
相关问题