I really like the .NET-provided facilities for storing configuration
information in App.config. The info is human-legible, and simple to
retrieve with the ConfigurationSettings class. It's also a good thing that
the deployed config file can't get separated from the executable that it
belongs to, and yet there lies the rub. Most of the time you want to use
multiple configs with the same executable in different environments
(production vs. training vs. staging, etc.).
But you can't do that when the name of the config file is lashed to the
executable's name as myApp.exe.config.
Microsoft's advice in Deployment .NET (Patterns and Practices) seems
to boil down to "keep multiple config files in your project, and rename the
one you want to use when you deploy." Not very helpful. They also offer
the Enterprise Library Configuration Application Block, which appears to be
too heavyweight for the apps I'm building today.
Nick Wienholt has started a series of articles on the problem.
Paul
Haley offers an extension to the format of App.config that provides for
multiple run-time configurations that looks useful.
posted:
5:16:13 PM
|