结构化变量替换不适用于 web.config (XML)
Structured variable replacement not working for web.config (XML)
八达通服务器 2021.1
我正在尝试使用结构化变量替换功能来替换 web.config (XML) 文件的部分内容,但它只尝试将文件读取为 Json 和 Yaml 但不是 Xml。该变量的名称如下:/configuration/system.webServer/rewrite/rules/rule/action/@url,其中@url 是元素的属性。
我尝试了很多东西,但似乎无法将 web.config 文件视为 XML 文件 - 有没有人有过在 Octopus Deploy 中使用这种类型的替换的经验?
web.config 中的代码如下所示:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="^api/(.*)" />
<action type="Rewrite" url="http://localhost:8053/api/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Web.config does not match any known filename patterns. The file will be tried as multiple formats and will be treated as the first format that can be successfully parsed.|
|---|---|
||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Web.config with format Json|
||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Web.config couldn't be parsed as Json: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.|
||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Web.config with format Yaml|
||15:22:17 Info | No structures have been found that match variable names, so no structured variable replacements have been applied.|
||15:22:17 Info | Structured variable replacement succeeded on file C:\Octopus\Work210612032325-158854-2674\staging\Web.config with format Yaml|
||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config does not match any known filename patterns. The file will be tried as multiple formats and will be treated as the first format that can be successfully parsed.|
||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config with format Json|
||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config couldn't be parsed as Json: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.|
||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config with format Yaml|
||15:22:17 Info | No structures have been found that match variable names, so no structured variable replacements have been applied.|
||15:22:17 Info | Structured variable replacement succeeded on file C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config with format Yaml|
八达通服务器 2021.1
我正在尝试使用结构化变量替换功能来替换 web.config (XML) 文件的部分内容,但它只尝试将文件读取为 Json 和 Yaml 但不是 Xml。该变量的名称如下:/configuration/system.webServer/rewrite/rules/rule/action/@url,其中@url 是元素的属性。 我尝试了很多东西,但似乎无法将 web.config 文件视为 XML 文件 - 有没有人有过在 Octopus Deploy 中使用这种类型的替换的经验?
web.config 中的代码如下所示:
<system.webServer> <validation validateIntegratedModeConfiguration="false" /> <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="true"> <match url="^api/(.*)" /> <action type="Rewrite" url="http://localhost:8053/api/{R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer>
||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Web.config does not match any known filename patterns. The file will be tried as multiple formats and will be treated as the first format that can be successfully parsed.| |---|---| ||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Web.config with format Json| ||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Web.config couldn't be parsed as Json: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.| ||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Web.config with format Yaml| ||15:22:17 Info | No structures have been found that match variable names, so no structured variable replacements have been applied.| ||15:22:17 Info | Structured variable replacement succeeded on file C:\Octopus\Work210612032325-158854-2674\staging\Web.config with format Yaml| ||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config does not match any known filename patterns. The file will be tried as multiple formats and will be treated as the first format that can be successfully parsed.| ||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config with format Json| ||15:22:17 Verbose | The file at C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config couldn't be parsed as Json: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.| ||15:22:17 Verbose | Attempting structured variable replacement on file C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config with format Yaml| ||15:22:17 Info | No structures have been found that match variable names, so no structured variable replacements have been applied.| ||15:22:17 Info | Structured variable replacement succeeded on file C:\Octopus\Work210612032325-158854-2674\staging\Views\Web.config with format Yaml|