msdeploy + setParameters.xml,如何设置Web物理文件位置 [英] msdeploy + setParameters.xml, how to set web physical file location
问题描述
这个问题已经绕过了一点,请原谅我,如果它是重复的,但我无法找到确切的答案.
This question has been danced around a bit, forgive me if it is a duplicate but I haven't been able to find an exact answer.
我正在尝试创建用于部署配置的Parameters.xml,该配置指定网站的目标物理文件文件夹.这是使用TeamCity进行的自动构建,例如命令行使用.deploy.cmd.
I am trying to create a Parameters.xml for deployment configuration that specifies the destination physical file folder for a web site. This is for an automated build using TeamCity, e.g. commandline using .deploy.cmd.
有人可以解释我需要做什么吗?
Can someone explain what I need to do?
Parameters.xml:
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
And in SetParameters.xml
<setParameter name="physicalPathLocation" value="C:\MyFolder\MySite" />
我怀疑我的问题在于如何声明范围,但不确定需要做什么.
I suspect my problem is in how I am declaring the scope but am unsure what needs to be done.
推荐答案
假定Default Web Site/iag.application.services.exampleservice
是IIS中的虚拟目录(DestinationVirtualDirectory
仅对应用程序"有效),您可能只需删除/
后缀而不对其进行编码. (我还删除了match
属性)
Assuming Default Web Site/iag.application.services.exampleservice
is a virtual directory in IIS (DestinationVirtualDirectory
is only valid for "applications"), you can probably just get away with removing the /
suffix and not encoding it. (I've also removed the match
attribute)
<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>
请记住,在设置参数之前,您不必必须声明参数.您可以轻松地声明完整参数并同时设置它:
Keep in mind that you don't have to declare parameters before you set them. You could just as easily declare the full parameter and set it at the same time:
<setParameter name="physicalPathLocation"
kind="DestinationVirtualDirectory"
scope="Default Web Site/iag.application.services.exampleservice"
value="C:\MyFolder\MySite" />
这篇关于msdeploy + setParameters.xml,如何设置Web物理文件位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!