简体   繁体   中英

XDT Transform of web.config is Append possible

I'm trying to update an existing appSettings in my web.config. I don't want to replace the entire value, but append my new value to the end. Is this possible?

Current value:

<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />

Required value:

<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/signalr" />

This is what I have currently in my transform file:

<add key="umbracoReservedPaths" value=",~/signalr" xdt:Transform="SetAttributes(value)" xdt:Locator="Match(key)"/>

You can insert a new element or modify an existing one but XDT transforms do not have the ability to append an attributes value to the original. MSDN Web.config supported transformations

Insert:

<add key="ExampleKey" value="true" 
        xdt:Transform="Insert" />

Update value attribute:

<add key="ExampleKey" value="true" 
        xdt:Transform="SetAttributes(value)" xdt:Locator="Match(key)"/>

Replace element:

<add key="ExampleKey" value="true" 
        xdt:Transform="Replace" xdt:Locator="Match(key)"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM