1

Closed

connection strings are getting removed

description

While using webconfig_apply, the command is adding the connection strings to the web.config file. Where as the connection string entries are not getting removed while using webconfig_remove command. The following are entries in the xml file.
 
<ConfigEntry>
<Name>connectionStrings</Name>
<Path>configuration</Path>
<Value><![CDATA[<connectionStrings />]]></Value>
<ModType>EnsureSection</ModType>
</ConfigEntry>
<ConfigEntry>
<Name>add[@key='pubsConnectionString']</Name>
<Path>configuration/connectionStrings</Path>
<Value><![CDATA[<add name='pubsConnectionString' connectionString='Initial Catalog=pubs;User Id=sa;password=p@ssword;Data Source=.\SQLEXPRESS' providerName='System.Data.SqlClient' />]]></Value>
<ModType>EnsureChildNode</ModType>
</ConfigEntry>
 
Please look in to this.
Closed Sep 19, 2009 at 12:13 AM by richfinn

comments

subhashkotu wrote Jul 14, 2009 at 8:41 AM

sorry. the title should be "connection strings are not getting removed".

richfinn wrote Jul 31, 2009 at 4:29 PM

This is not due to a bug, but rather the order in which the items are being removed. Since you are removing the <connectionStrings/> section before you are removing the <add/> item, it doesn't know what to do. Try creating a second file used for the remove command that first removes the <add/> item, then removes the <connectionString/> section...

wrote Sep 19, 2009 at 12:13 AM

wrote Feb 2, 2013 at 5:06 AM

wrote May 15, 2013 at 4:07 AM