locked
one Config file for many applications and assemblies RRS feed

  • Question

  • Hi all

    I am developing a software in c# which consist of many components (.EXE, dll, windows servic,...).
    some setting are shared between more than on assembly (say database name).
    If I create a config file for each component, then I need to update each one if the database is changed by some component.

    I don't like to use registry. Is there any idea to use (and must be easy like a config file) so all applications can read from one source / place file?

    thanks

    Khayralla
    Friday, October 17, 2008 2:08 AM

Answers

  • Thanks Mattias

    It is a good starting point.

    So, the config file of the main application will contain all infrmation.

    and each dll assembly will contain a ref to the main config file.
    e.g.:

    <configuration>
       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <linkedConfiguration href="file://c:\Program originalAttribute="href" originalPath="file://c:\Program Files\abc\Main.exe.Config.xml"/>
       </assemblyBinding>
    </configuration>

    Is this correct ?

    thanks

    Khayralla


    Friday, October 17, 2008 2:06 PM

All replies

  • Perhaps you could use the <linkedConfiguration> element in each applications config file to point to another, shared config file with common settings?

    Mattias, C# MVP
    Friday, October 17, 2008 7:17 AM
  • Thanks Mattias

    It is a good starting point.

    So, the config file of the main application will contain all infrmation.

    and each dll assembly will contain a ref to the main config file.
    e.g.:

    <configuration>
       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <linkedConfiguration href="file://c:\Program originalAttribute="href" originalPath="file://c:\Program Files\abc\Main.exe.Config.xml"/>
       </assemblyBinding>
    </configuration>

    Is this correct ?

    thanks

    Khayralla


    Friday, October 17, 2008 2:06 PM