2
我想补充以下内容上发布web配置:Web.config文件转换添加树
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=16070400; includeSubDomains" xdt:Transform="Insert" />
</customHeaders>
</httpProtocol>
</system.webServer>
有没有在默认的Web配置任何自定义页眉,所以我得到一个错误,当我发布: No element in the source document matches '/configuration/system.webServer/httpProtocol/customHeaders'
。
我能解决这个问题我刚刚加入空元素在web.config中像这样:
<httpProtocol>
<customHeaders>
</customHeaders>
</httpProtocol>
但是,它不觉得像正确方式。
有没有更正确的方法来构建变换上的元素树?
已尝试删除xmlns =属性? –