XDT:转换="插入"不工作的<&改写GT;上述< system.webServer> [英] xdt:Transform="Insert" not working for <rewrite> in <system.webServer>

查看:332
本文介绍了XDT:转换="插入"不工作的<&改写GT;上述< system.webServer>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的变换写在我的web.config的现场配置。

I have the following transform written in the live config of my web.config.

<system.webServer>
    <rewrite xdt:Transform="Insert">
      <rules>
        <rule name="httpsrewrite">
          <match url=".*" />
          <serverVariables>
            <set name="SERVER_PORT" value="443" />
            <set name="HTTPS" value="on" />
          </serverVariables>
          <action type="None" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>

有在我的web.config没有元素。

There is no element in my web.config.

该转换是行不通的。我所有的其他的变换(取代ELMAH和连接字符串),做工精细。

The transform just does not work. All my other transform (replace for elmah and connection string) work fine.

推荐答案

在没有看到你的源文件,很难给出一个明确的答案。

Without seeing your source files it's hard to give a definitive answer.

在你的web.config文件,你的必须的有/configuration/system.webServer元素present的转换工作。如果没有的话那么就没有元素要插入/configuration/system.webServer/rewrite元素。

In your web.config file you must have a /configuration/system.webServer element present for the transform to work. If you do not have it then there is no element for which to insert the /configuration/system.webServer/rewrite element.

如果这没有帮助,请张贴既你的web.config和转换文件的至少结构。此外,我建议你安装SlowCheetah VS扩展这是伟大的故障排除/ previewing变换。

If this doesn't help, please post at least the structure of both your web.config and the transform file. Also I suggest you install the SlowCheetah VS extension which is great for troubleshooting / previewing transforms.

这篇关于XDT:转换=&QUOT;插入&QUOT;不工作的&LT;&改写GT;上述&lt; system.webServer&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆