Reputation: 3716
I'd like to know what's the best way to add keys in the machine.config file at the application deployment ? We have a series of WinForm apps that will need to use some keys that we wnat to store in the machine.config.
Thanks for your advices !
Upvotes: 0
Views: 236
Reputation: 111
You could add a custom action to your installer (if you use one) that loads the machine.config, parses the xml, then adds the keys to the appropriate place, then saves the machine.config again. Only thing to be careful about is to create a backup before loading, parsing and writing the new contents and have some kind of rollback mechanism if any of these steps fails.
Upvotes: 1