0

I have looked here and here and almost found the answer to what I'm looking for but not quite.

If I publish a new version of my app and the user launches their install they will be prompted to install a new version. At which point, the entire App.config is overwritten with the published version. I would like to maintain the App.config between upgraded versions on the local machine install.

The links above don't solve my issue because I am not using the Properties.Settings.Default namespace but rather custom config sections in my App.config called with ConfigurationManager. Thus I need an exact copy maintained of my App.config between upgrades.

Thank you

SaintRocker96
  • 31
  • 1
  • 3
  • 1. Don't publish app.config. in post-build rename it to app.config.sample. user will keep old config. Then will take old and populate sample and rename it to have the latest. 2. Keep your custom section in the separate file on user boxes. Your new config will overwrite only the config file but not the files where user keeps section info – T.S. Aug 24 '21 at 03:01
  • I am a little unclear on this solution. As soon as the user installed application updates version it creates a new install of the entire application including whatever the published app config is. The old config is in a separate install of the application. Is there a way to specify update events? – SaintRocker96 Aug 24 '21 at 17:18
  • To add some clarification I cant seem to not publish app.config. Even if i delete it in Post Build, yes it doesnt show up in bin/Release but is still created as a Deploy file in the published folder location. Therefore when updating an installed version this new app.config is used – SaintRocker96 Aug 24 '21 at 17:45
  • there is an answer for this https://stackoverflow.com/questions/4794399/how-to-exclude-app-config-from-setup-deployment-project – T.S. Aug 24 '21 at 18:42

0 Answers0