I have been trying to read up on how to do configuration properly in .net and have run into something that I find a bit odd and that is that configuration settings are compiled into assemblies through the Settings class. Removing the app.config and running the application does not result in configuration errors as I was expecting but rather now I have no way of replacing the configuration values.
In my application I have a configuration setting for a webservice url that I need to be able to pick up and set programmatically. Should I be creating custom sections in the configuration for my application that I will read through the ConfigurationManager.GetSection(..) to trigger reading of the config file or is there another way around this problem as I absolutely don't want the webservice url used to generate the ws proxy as an url that could potentially leak into production.
Please help.
Try adding an application configuration file to your project rather than a settings file. An application configuration file does not get compiled into the assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With