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:
- Go to the filesystem in my project directory and delete
app.config
- Copy
app.config.foo
toapp.config.foo - Copy
. - Rename
app.config.foo - Copy
asapp.config
. - Tell Windows that yes, I want to change the file's extension.
- Switch back to Visual Studio.
- Open the
Settings.settings
item in my project. - Click "Yes" 13 or 14 times as VS asks me if I want to use the new settings that have been changed in
app.config
. - Close
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?