There are few workarounds:
Workaround 1
- Write
AppSettings.Debug.config
,AppSettings.Release.config
with full values (not with transform attributes) - In your
web.config
, using transformation, substitute with the appropriate file:
web.debug.config
<appSettings file="AppSettings.debug.config"
xdt:Transform="SetAttributes" xdt:Locator="Match(file)"/>
web.release.config
<appSettings file="AppSettings.release.config"
xdt:Transform="SetAttributes" xdt:Locator="Match(file)"/>
Its less than ideal, kinda defeats the purpose of transforms but may be appropriate based on one’s situation than using something like SlowCheetah.
Workaround 2
Use TransformXml
build task to transform your files during build as pointed here and here