slow-cheetah icon indicating copy to clipboard operation
slow-cheetah copied to clipboard

Preview Transform not working for app.config

Open liarsing opened this issue 7 years ago • 7 comments

Environment: Win7 x64 VS2015 WPF application App.config Add Transform is done App.Debug.config and App.Release.config are generated and shown in solution explorer

No matter how I change the App.Debug.config or App.Release.config, the "Preview Transform" shows NO DIFF in the comparing window. Both sides are the same as App.config

liarsing avatar Aug 31 '17 10:08 liarsing

Does the transform work on build? Is there any warnings regarding the transform on build?

jviau avatar Sep 05 '17 20:09 jviau

The transform doesn't work on build too. It does nothing. There is no warning on build.

liarsing avatar Sep 06 '17 04:09 liarsing

Hi, same problem with VS2017 , i had and trasformation for"App.config" I press "Add Transform" is done App.Debug.config and App.Release.config are generated and shown in solution Explorer, but is not apply anyone trasformation built time, i check in preview windows but two file are identical.

sgrips avatar Sep 07 '17 13:09 sgrips

Same problem here.

bdominguez avatar Sep 16 '17 08:09 bdominguez

@liarsing @sgrips @bdominguez
Maybe you made the same mistake as me. <appSettings> <add key="xxxx" value="xxx" xdt:Transform="Replace" xdt:Locator="Match(key)"/> </appSettings> xdt:Transform and xdt:Locator should never be lost in app.XXX.config.

shenzhigang avatar Feb 05 '18 07:02 shenzhigang

@liarsing @sgrips @bdominguez Can you guys provide the source and transformation files? Or examples of files that do exhibit the same issue?

davilimap avatar Apr 25 '18 18:04 davilimap

@shenzhigang I have no idea, how I missed it but thank you so much for pointing me in the right direction. When I included xdt:Transform and xdt:Locator in the app.XXX.config it worked like a charm.

For all others, please do not forget to add transform and locator as highlighted in bold below, otherwise you will not be able to see any differences in Preview Transform and also the changes will not be overwritten in the actual .config file after build in the respective build directory.

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

Thanks once again.

john77y avatar Nov 20 '19 10:11 john77y