views:

449

answers:

1

As far as I understand all default settings of app.config settings is hard coded in the application and will generated on the fly in the first run.

If this is true then there is no good reason to deploy these files with an installer or in a zip package, am I right? Or am I missing something in here.

I want to be sure before rolling out the next release.

+6  A: 

Default settings are hard coded, but required settings are not. If you have any required settings at all, then your application will throw an exception when trying to load the section the required setting is in if it doesn't exist, and if the file doesn't exist, then the setting doesn't exist.

Also, this only applies to custom sections... If you use default sections like ConnectionStrings, then you need to deploy your app.config with your application, because this is the only place these are stored.

Long story short, yes, you do need to deploy app.config with your application.

Matthew Scharley
This is desktop application and only relies on the My.Settings (VB.NET). And what is "required" settings?
dr. evil
If you have an app.config file, you need to deploy it. I'm 90% sure that My.Settings is seperate, but I could be wrong.
Matthew Scharley
Ok, I've done some research. If you have an app.config file in your PROJECT, then yes, you need to deploy it. If you only have one in your project output (ie. /bin/Debug/app.config), then it's safe to discard it in your deployment as it's just saved settings from testing.
Matthew Scharley
Required settings are something from custom configuration sections... It's a little more complex then just relying on My.Settings, but it's alot more flexible. Have a look here for more info: http://www.codeproject.com/KB/cs/CustomConfigurationSectio.aspx
Matthew Scharley