Search code examples
winformsconfiguration-filessetup-deployment

Winforms: Write app.settings during Setup


I've battled with modifying Configuration settings in the App.config file in the past, and gave up any hope of making it work. Now again, I find myself in the same shoes, but this time determined to sort it out!

The application Im creating is a WindowsForms .NET 3.5 (SP1) app. It is to be used in a closed, networked environment. It is not a SmartClient app, but an "always-connected" one, and transacts over the local network with a central database server.

The app works fine, and now that Im ready to deploy and create the setup files, I must ask 2 very important questions:

  1. How do I (especially!) 'modify' the ConnectionString value from the Setup Wizards? ;and
  2. How/where do/should I encrypt this value?

This is surely something every developer goes thru when moving from development to production, and I would sincerely appreciate any help.

Thank you!


Solution

  • This question provides good information on how to modify the configuration file (in general) during setup.