删除 web.config 条目的命令

Command to remove web.config entry

我正在使用以下命令在 Web.config

中添加一个条目
C:\Windows\System32\inetsrv>appcmd set config "MarketWorkFlowWebApp" section:system.webServer/security/requestFiltering /allowDoubleEscaping:false

输出:

Applied configuration changes to section "system.webServer/security/requestFiltering" for "MACHINE/WEBROOT/APPHOST/MarketWorkFlowWebApp" at configuration commit
 path "MACHINE/WEBROOT/APPHOST/MarketWorkFlowWebApp"

添加设置工作正常。

要删除上面的条目,我正在使用以下命令

 C:\Windows\System32\inetsrv>appcmd set config "MarketWorkFlowWebApp" -section:system.webServer/security/requestFiltering

输出:

Applied configuration changes to section "system.webServer/security/requestFiltering" for "MACHINE/WEBROOT/APPHOST/MarketWorkFlowWebApp" at configuration commit
     path "MACHINE/WEBROOT/APPHOST/MarketWorkFlowWebApp"

但是 web.config 仍然包含这些条目。

那么如何从 web.config.

中删除任何现有标签

这对我有用:

appcmd.exe set config "Default Web Site/" -section:system.webServer/security/requestFiltering /allowDoubleEscaping:"True"

然后清除它...

appcmd.exe clear config "Default Web Site/" -section:system.webServer/security/requestFiltering /allowDoubleEscaping