【问题标题】:Visual Studio Web.Config TransformVisual Studio Web.Config 转换
【发布时间】:2014-09-22 18:03:31
【问题描述】:

我们的 web.configs 转换得很好。

但是,对于其中一个,我们需要将所有这些添加到 web.config。

不确定如何添加整个 XML 节点。

system.webServer
<rewrite>
  <rules>
    <rule name="Redirect To HTTPS" enabled="true" stopProcessing="true">
      <match url="(.*)" />
      <conditions logicalGrouping="MatchAll">
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
    </rule>
  </rules>
</rewrite>

【问题讨论】:

  • 不建议将 XML 添加到 XML 文件中。您应该编写自己的配置部分。这是一篇关于 msdn link 的直截了当的文章

标签: c# visual-studio web-config web.config-transform


【解决方案1】:

在目标转换配置文件内的&lt;rewrite&gt; 节点上使用xdt:Transform="Insert"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-06-19
    • 1970-01-01
    • 1970-01-01
    • 2014-04-23
    • 1970-01-01
    • 1970-01-01
    • 2011-08-09
    • 1970-01-01
    相关资源
    最近更新 更多