Configuration tool removes LocalSqlServer from connectionStrings

Topics: Data Access Application Block
Jul 15, 2008 at 4:34 PM
As is reported in http://www.codeplex.com/entlib/WorkItem/View.aspx?WorkItemId=9751, every time I use the configuration tool, the LocalSqlServer entry from the connectionStrings section in web.config is stripped:

  <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer"
    connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=DBDev;User Id=xxx;Password=xxx"
    providerName="System.Data.SqlClient" />
    <add name="MyConnectionString"
    connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=DBDev;User Id=xxx;Password=xxx"
    providerName="System.Data.SqlClient" />
  </connectionStrings>

Only the MyConnectionString entry remains, after an edit. This has something to do with the entry in machine.config for LocalSqlServer, but I don't want to remove it there, since all developers will have to do this on on their machines also...

Is there a known workaround?
Jul 16, 2008 at 5:56 PM
I've found my own workaround:
Simply use an alternate configuration source, as described in the documentation "Using Alternate Configuration Sources". I've moved the entlib configuration to a "File Configuration Source" named "entlib.config". Now the configuration tool only needs to work on "entlib.config" leaving my "web.config" intact.