469,946 Members | 1,750 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Custom section in config file problem

1
Hi,

I have a problem in accessing "sqlServerCatalogNameOverwrites" section in app.config file.

Expand|Select|Wrap|Line Numbers
  1. <configuration>
  2.   <configSections>
  3.     <section name="sqlServerCatalogNameOverwrites"  type="System.Configuration.NameValueSectionHandler" />
  4.   </configSections>
  5.  
  6.   <sqlServerCatalogNameOverwrites>
  7.     <add key="ISDev17" value="ISDev18" />
  8.   </sqlServerCatalogNameOverwrites>
  9. </configuration>
Third party software requires such configuration which i need to modify programatically.

I've tried
Expand|Select|Wrap|Line Numbers
  1. ConfigurationManager.GetSection("sqlServerCatalogNameOverwrites")
but this accesses readonly configuration information.


I've also tried

Expand|Select|Wrap|Line Numbers
  1. Configuration config = ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel.None);
  2. ConfigurationSection section = config.GetSection("sqlServerCatalogNameOverwrites");
Now i'm in stuck accessing key-value pair.
I should implement "ConfigurationSection", "ConfigurationElement", "ConfigurationProperty" and point to my own type in config file.
Problem is i can't change type, section type must be System.Configuration.NameValueSectionHandler.

Is any way to change the configuration?

Any help is appreciated.
Dec 16 '09 #1
0 1570

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Søren Lund | last post: by
4 posts views Thread by Nick Gilbert | last post: by
3 posts views Thread by Mads Brydegaard | last post: by
1 post views Thread by Paloma García | last post: by
6 posts views Thread by Tabi | last post: by
6 posts views Thread by Jeff Hegedus | last post: by
7 posts views Thread by =?Utf-8?B?RG91Z2llIEJyb3du?= | last post: by
reply views Thread by Atul Thombre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.