473,395 Members | 1,341 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,395 software developers and data experts.

Can't get the updated value from configurationsetting.appsetting

Dear All,

I use function configurationsettings.appsetting to retrieve the
connection string value which stored in a file app.config. At the beginning,
it's fine that it can pick up the value according to the key passed into
function. But when I make some change in the value of app.config, it still
pick up the old value to me, not the updated one. I'd tried to rebuild the
project or quit the vb.net and re-start it again. It still pick up the old
value to me. Can anyone tell me what should I do? Please help. Thanks

Best Rdgs
Ellis
Jul 21 '05 #1
2 2698
Make sure that the correct config file is being copied to the folder with
your executable.

"Ellis Yu" <el******@transfield.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Dear All,

I use function configurationsettings.appsetting to retrieve the
connection string value which stored in a file app.config. At the
beginning,
it's fine that it can pick up the value according to the key passed into
function. But when I make some change in the value of app.config, it still
pick up the old value to me, not the updated one. I'd tried to rebuild the
project or quit the vb.net and re-start it again. It still pick up the old
value to me. Can anyone tell me what should I do? Please help. Thanks

Best Rdgs
Ellis

Jul 21 '05 #2
>I use function configurationsettings.appsetting to retrieve the
connection string value which stored in a file app.config. At the beginning,
it's fine that it can pick up the value according to the key passed into
function. But when I make some change in the value of app.config, it still
pick up the old value to me, not the updated one.


Yes, the app settings stuff works by grabbing and interpreting the
..config file ONCE, at startup of the app. It will *NEVER* pick up any
subsequent changes at runtime. The whole "MyApp.exe.config" stuff is
*NOT* intended to be used for settings that need to be updated - it's
designed from ground up to be read-only, and read only once, at app
startup.

If you need more dynamic settings (which can be updated and stored and
changed at runtime), you'll need to look elsewhere - check e.g.
www.codeproject.com for a wealth of "user settings" components that
will store your preferences in text, XML or other files, anywhere on
your disk (the "isolated storage" area would be the preferred location
for safety reasons), or in the registry (discouraged in .NET to do
so).

Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Jul 21 '05 #3

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

Similar topics

2
by: Julia | last post by:
Hi, My host application loading plugins at runtime How can I dynamically load types from a dll without specify the name of the dll in my application or in a config file can I give a dll an...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
9
by: james | last post by:
According to the documentation ConfigurationSetting.GetConfig( string ) is used to get user defined config settings. Yet, no matter how I try to add my own sections to the app.config I keep...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm tring to read the appSettings from my Web.config file in Visual Studio.Net (Code behind page) and it doesn't recognize ConfigurationSettings.AppSetting? Yet it works in my .aspx...
6
by: Marcos MOS | last post by:
Hi, I've put a appSetting tag into my web.config, but when I try to catch its value to my Image WebControl occurs the follow error: "Server tags cannot contain <% ... %> constructs." on...
1
by: somequestion | last post by:
i work on asp.net 2.0 so i have to change property of web.config file on the web page i mean when i make a board i want to change PageSize in the web.config file. so i use...
2
by: Ellis Yu | last post by:
Dear All, I use function configurationsettings.appsetting to retrieve the connection string value which stored in a file app.config. At the beginning, it's fine that it can pick up the value...
5
by: cdtsly | last post by:
Hi i have a table with all value at 4 i select all lines in a fetch i update one with a value of 7 i update all the row in the fetch with a value 5 the result is that all my row are at 5 and...
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I have right clicked my project in VS2008 and added a DB Connection application setting. How do I access these settings from my code? I know this must be pretty simple, but I cannot see...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.