0

We have an IIS based application with different web apps, some third party components and several services.

  • Server1

    • AppPool1
      • App1
    • AppPool2
      • Third party app
  • Server2

    • AppPool3
      • Third party app 2
      • App2
    • Windows Service
    • CLR Stored Proc

The goal is to put all environment relevant settings (such as connection strings, URLS, etc.) into a single configuration file per environment (dev., test, integration, production). The application relevant stuff should be based on this 'global' settings file and individual settings files per application.

I have to use the built-in static System.Configuration.ConfigurationManager class because some third party tools depend on it.
I know of the following possible approaches using System.Configuration.ConfigurationManager:

  • Individual files (current, redundant approach)
  • Machine.config (too global)
  • Hierarchical configuration in IIS (doesn't affect Service and CLR Proc)

Edit: The linkedConfiguration element only affects loader binding policies.

Are there other methods? Which one is best?

janv8000
  • 1,569
  • 2
  • 19
  • 33
matthias.lukaszek
  • 2,200
  • 1
  • 23
  • 33

1 Answers1

0

I'm going to assume you are using a database. You can create a DB in your database server to store configuration values, either shared or per-application. Then, the only thing you need to store in each web.config is a connection string to the "configuration database".

Or, perhaps you can create a Web Service that serves up configuration values in a similar way.

HardCode
  • 6,497
  • 4
  • 31
  • 54
  • Of course we have a DB, the CLR stored proc is located in one of the DBs. But I explicitly mentioned the static `ConfigurationManager` class which does not support configs provided by DB or services. I have to use this built in standard because the third party tools depend on it. – matthias.lukaszek Oct 05 '11 at 21:47