Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you manage .NET app.config files for large applications?

Tags:

People also ask

How many app config file in asp.net application?

Application configuration files Executable–hosted app. These apps have two configuration files: a source configuration file, which is modified by the developer during development, and an output file that is distributed with the app.

Where are .NET application settings stored?

settings is located in the My Project folder for Visual Basic projects and in the Properties folder for Visual C# projects. The Project Designer then searches for other settings files in the project's root folder. Therefore, you should put your custom settings file there. If you add a .

How many web config files can be allowed to use in an application?

Yes you can have two web. config files in application.

What can be used to store configuration settings of an application?

In a Microsoft Azure hosted application, a possible choice for storing configuration information externally is to use Azure Storage.


Suppose a large composite application built on several foundation components packaged in their own assemblies: (database reading, protocol handlers, etc.). For some deployments, this can include over 20 assemblies. Each of these assemblies has settings or configuration information. Our team tends to like the VS settings editor (and the easy-to-use code it generates!), and the application vs. user distinction meets most of our needs.

BUT....

It is very tedious to copy & paste the many configuration sections into our application's .xml. Furthermore, for shared components that tend to have similar configurations across applications, this means we need to maintain duplicate settings in multiple .config files.

Microsoft's EntLib solves this problem with an external tool to generate the monster .config file, but this feels klunky as well.

What techniques do you use to manage large .NET .config files with sections from multiple shared assemblies? Some kind of include mechanism? Custom configuration readers?

FOLLOWUP:

Will's answer was exactly what I was getting at, and looks elegant for flat key/value pair sections. Is there a way to combine this approach with custom configuration sections ?

Thanks also for the suggestions about managing different .configs for different build targets. That's also quite useful.

Dave