【问题标题】:Msdeploy replace attributeMsdeploy 替换属性
【发布时间】:2012-09-11 10:02:06
【问题描述】:

我正在尝试使用 msdeploy 从我在源 IIS 7 站点上创建的包还原目标计算机上的站点。目标服务器 IIS 也是 IIS7。 但是,目标服务器没有驱动器 D: 作为物理驱动器。 D: 与 CD Row 驱动器相关联。 我在使用 msdeploy 时使用了 replace 属性,但该规则不起作用。 下面是我的命令 msdeploy -verb:sync -source:package=d:\site.zip -dest:apphostconfig="默认网站" -replace:objectName="metaProperty",scopeAttributeName="name",scopeAttributeValue="Path",targetAttributeName=" value",match="d:",replace="c:" -verbose -whatif > msdeploysync.log

但是,-whatif 没有显示更改为 C: 的路径,而且如果我运行命令,我会收到消息说“设备未准备好”,这意味着 D: 替换不起作用。

我被卡住了..有什么帮助吗?

【问题讨论】:

    标签: msdeploy


    【解决方案1】:

    提供的更改路径的机制(请注意,以非 IIS 版本特定的方式)是设置DestinationVirtualDirectory 类型的参数:

    -setParam:kind=DestinationVirtualDirectory,scope="Default Web Site",value="c:\full\path\to\website"
    

    如果您想简单地更换驱动器,请尝试将您的替换指令更改为:

    -replace:objectName=virtualDirectory,scopeAttributeName=physicalPath,match=^C:,replace=D:
    

    这里有一些关于各种参数类型的官方文档:Using declareParam and setParam

    【讨论】:

    • 今天让我试试这个。但看起来合理。谢谢
    猜你喜欢
    • 1970-01-01
    • 2018-05-06
    • 1970-01-01
    • 2022-01-24
    • 2013-03-06
    • 2012-11-15
    • 2010-10-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多