By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,717 Members | 2,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,717 IT Pros & Developers. It's quick & easy.

Can't get the updated value from configurationsetting.appsetting

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
>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 discussion thread is closed

Replies have been disabled for this discussion.