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 =屬性? –