ConfigurationManager RefreshSection not "refreshing"

  • Thread starter Thread starter roundcrisis
  • Start date Start date
R

roundcrisis

HI there:


I have to modify the value of an item in appSettings

ConfigurationManager.AppSettings["somekey"] = somevalue;
ConfigurationManager.RefreshSection("appSettings");

however the value is nto refreshed, any ideas?
 
RefreshSection refreshes so that the next time the configuration is read it
will read from the disk instead of Cache. However, you still need to read it:

The GetSection method accesses run-time configuration information that it
cannot change. To change the configuration, you use the GetSection method on
the configuration file you obtain by using one of the following Open methods:

OpenExeConfiguration

OpenMachineConfiguration

OpenMappedExeConfiguration

OpenMappedExeConfiguration
 
RefreshSection refreshes so that the next time the configuration is read it
will read from the disk instead of Cache. However, you still need to read it:

The GetSection method accesses run-time configuration information that it
cannot change. To change the configuration, you use the GetSection method on
the configuration file you obtain by using one of the following Open methods:

OpenExeConfiguration

OpenMachineConfiguration

OpenMappedExeConfiguration

OpenMappedExeConfiguration

--
--Peterhttp://www.eggheadcafe.com
unBlog:http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



roundcrisis said:
HI there:
I have to modify the value of an item in appSettings
ConfigurationManager.AppSettings["somekey"] = somevalue;
ConfigurationManager.RefreshSection("appSettings");
however the value is nto refreshed, any ideas?- Hide quoted text -

- Show quoted text -

this worked thanks
 
Back
Top