Search code examples
c#xsltslowcheetah

c# App.Config file not transforming when building for Test deployment


I am using slow cheetah in my app such that I can have app.config files that will transform in the same manner as web.config transforms. I have used this in other projects with no issue, but for some reason in one of my projects, the cofing file is not changing.

A sample from my App.Test.config is the following:

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

And the corresponding line in my App.config file is

<add key="timer" value="15"/>

Solution

  • The problem turned out that I did not include the <AppSettings> tag before the <Add> tag in the transform. So when the transform went to take place it would look for the key timer within <Configuration> and not <Configuration> <AppSettings>