Closed Axemasta closed 1 year ago
Closing after merge of #317
Remember if your config looks like this:
<configuration>
<appSettings>
<add key="foo" value="my foo" />
<add key="foo2" value="my foo 2" />
</appSettings>
</configuration>
You MUST use the xdt:Locator
attribute otherwise your config will fail to load properly 😁
Description
If you have 2 app config names that are similarly named (ie
AppCenterAndroidSecret
andAppCenterIosSecret
) the config transforms will not be applied properly. The config transform is usingMicrosoft.Web.XmlTransform
so that issue will be caused by that library, however the configuration of the XML can be updated in order to have both of these keys match.Reproduction Steps
Steps to reproduce the behavior:
xdt:Locator
attribute is not presentExpected Behavior
Expected transformed XML document:
Actual Behavior
foo
is not replaced and instead is empty:Here is the transformed xml as it gets returned by
TransformHelper
(sb.ToString()
)Environment
Reproduction App
I have forked this repo and have a branch with a reproduction of the issue (app-config-repro)
Proposed Fix
Update the documentation & sample app to include the
xdt:Locator
attribute for the transform XML aswell as a note about this behaviour.