I have created a setup project for a Windows Service that was written in .NET. The Service depends on several elements in the App.config that is different in the dev environment from production environment (ex: path to a folder)
I now have the MSI file that I can run in production to install the service. However, how do I change the value of config elements?
I am not sure what the best practice is.
This is not a best practice, but rather what I do, in case you may find it interesting.
I make copies of the App.config, let’s say App.config.debug and App.config.production, and I just open App.config and the appropriate other file and then copy/paste into the App.config as needed. Yes, it’s not ideal and it would certainly suck if you had more than one production deployment target, but I haven’t found anything I liked more. If you’re using source control you might choose to leave the App.config out of it, since with my convention it is just a copy of one of the other files.