Web.config转换部分适用

时间:2016-08-04 07:24:33

标签: asp.net visual-studio msbuild web-deployment

在我的 web.Release.config 中,我定义了三个转换:

with open('/council/council1', 'r') as input_file:
   text = input_file.read()
print(text)

预览转换应用/发布都表明只转换了编译标记。

无法理解为什么 httpCompression / 计划标签保持不变?

以下是原始 web.config 内容的摘录:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
  </system.web>
  <system.webServer>
    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" xdt:Transform="SetAttributes" xdt:Locator="Match(directory)">
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" xdt:Transform="SetAttributes" xdt:Locator="Match(dll)" />
    </httpCompression>
  </system.webServer>
</configuration>

1 个答案:

答案 0 :(得分:1)

@lexeme您的代码不正确。请尝试以下代码:

 <system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" xdt:Transform="SetAttributes">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</httpCompression>