Sheen
Sheen

Reputation: 3431

How to best manage shared app config contents among projects

I have one back-end DLL project, which is layer on top of database. I have several fron-end projects, with either app.config or web.config. All front-end projects share some configuration sections.

Manually keeping the shared config sections in sync before testing and release looks stupid. What is good practice to get the config shared?

Upvotes: 0

Views: 66

Answers (1)

Paolo Costa
Paolo Costa

Reputation: 1989

You can put your common section in a separate file:

<connectionStrings configSource="ConnectionStrings.config"/>

and ConnectionStrings.config file will contain:

<?xml version="1.0"?>
  <connectionStrings>
    <add name="MyDB" connectionString="Data Source=address;Initial Catalog=DataBase;Integrated Security=SSPI;"/>
  </connectionStrings>

Then, in order to share the settings between multiple projects you can follow the advice you find here

Upvotes: 2

Related Questions