|
-
Jan 16th, 2008, 11:15 AM
#1
[2008] My.Settings not saving?!
Hey,
I have used My.Settings for quite some time now, in both VS2005 and now in 2008, but never noticed this behaviour yet... I must be forgetting something trivial?!
I create a StringCollection setting and manually enter some data (strings).
I write some code to handle this, and I get it to work.
Then, I manually add some new strings (and edit the older ones) in the Settings page, save the project, and run my code again.
For some reason, the last changes have not been saved... Whenever I look in the settings page, I see them there, but my code cannot recognize them...
// EDITED //
Am I forgetting something, or is there something wrong with VS?
EDIT
I did add "My.Settings.Reload()" at the start of the code that displays the value... Not sure if I need to do that, but it can't hurt, can it?
EDIT2
It only seems to do this with a StringCollection. If I try to manually change a normal String than it picks it up fine.\
I can reproduce this doing the following:
- Create new project.
- Add a StringCollection setting via the project's properties 'Settings' page, the StringCollection setting is called "Test" and it's value is one line with "line1" and a second line with "line2".
- Make my program display the lines in a Msgbox: "MessageBox.Show(My.Settings.Test(0) & " " & My.Settings.Test(1))"
- Output is "line1 line2"
- Manually change the settings lines to "line1 And some text" and "line2 And some text".
- Save project
- Run program again, output is still "line1 line2".
...
Last edited by NickThissen; Jan 16th, 2008 at 11:39 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|