I'm building an application that is used by several different customers. Each customer has a fair amount of custom business logic, which I have cleverly refactored out into an assembly that gets loaded at runtime. The name of that assembly, along with a number of other customer-specific settings, are stored in the application's configuration file.
Right now, here's what I have to do in order to debug the application for customer foo:
app.config
app.config.foo
to app.config.foo - Copy
.app.config.foo - Copy
as app.config
.Settings.settings
item in my project.app.config
.Settings.settings
.Okay! Now I'm ready to debug!
It seems to me that the rigamarole of opening Settings.settings
is, or ought to be, unnecessary: I don't need the default values in Settings.cs
to be regenerated, because I don't use them. But it's the only way I know of to make VS aware of the fact that the app.config
file has changed, so that the build will copy it to the output directory.
There's got to be an easier way of doing this. What is it?
You can also let Visual Studio automate Robert`s approach by:
VS will drop a distinct build for your clients in separate folders, aolong with the proper config file. bin/Client1/ bin/Client2/
You can refer this post for some good practices : Managing Multiple Configuration File Environments with Pre-Build Events
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