473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ConfigurationManager RefreshSection not "refreshing"

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?

Nov 14 '07 #1
2 7558
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
--
--Peter
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"roundcrisis" wrote:
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?

Nov 14 '07 #2
On Nov 14, 7:24 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
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" wrote:
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

Nov 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Scott Brady Drummonds | last post by:
Hi, everyone, I'm still learning Python as I develop a medium-sized project. From my previous experience with C++, I've burnt into my mind the notion of information hiding. I'm having trouble...
6
by: Don Leverton | last post by:
Hi All, I've got a situation where I am developing an Access 97 app for a client, and am in the "beta testing" stage. I have split the app up, using the DB splitter, into front-end /back-end...
3
by: John Baker | last post by:
Hi: As in the "Wizard of Oz", I want people to "pay no attention to the man behind the curtain", by freezing the screen while a whole lot of things happen. I know about ECHO OFF, but this...
9
by: John Walker | last post by:
Hi, I have a datagrid with a radiobutton template column, with AutoPostBack set to TRUE. When the user clicks on a radiobutton the application will PostBack, and in the PostBack there will be...
2
by: IkBenHet | last post by:
Hello, I am uploading a file using this form in ASP.NET. I have also added a simpel textfield: <form runat="server" enctype="multipart/form-data"> <input type="file" id="oFile" Name="oFile"...
3
by: Ray Stevens | last post by:
I know there is a setting that will prevent screen flashing when refreshing a web page but cannot seem to find it. Can someone point me in the right direction?
5
by: Jozef | last post by:
Hello, I have an Access XP database that has attachments to a BE database that has a password. The attachments work fine, until I run some code that modifies a BE table (adding a field). I do...
5
by: rod.weir | last post by:
Hello, I have the following code to iterate through each view in a SQL Server and call the "sp_refreshview" command against it. It works great until it finds a view that is damaged, or otherwise...
3
by: kjworm | last post by:
Greetings, I have a report displayed on a screen that anyone in the office can look at. The data on this report will change from time to time. This report has different colors displayed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.