Visual Basic Development Bookmark and Share   
 Home > Visual Basic IDE > Properties settings anomaly
 

Properties settings anomaly

I am having a problem with my properties settings variables not working like they are supposed to.EX:

my.settings.demo=true
'
'code...
'
my.settings.democount+=1
'
'code....
'
my.settings.save

The next time I run the program from the IDE, debugging it, I check the properties settings for democount and it is still set to zero, but when I run the program from the IDE, it has been incremented like I expected. What I didn't expect was that when I went to reset it in properties settings, it was still zero, but not in the actual program. I have tried clicking on Syncronize, but it does not help. The propert settings change and are saved correctly, I just don't seem to be able to see their current values in the IDE , as they all look as though they have never been changed from when I set them initially.
I am confused. Am I doing something wrong? Maybe I simply don't understand how they work.

What I want to do is this: Set my demo variable to true in properties settings and have the demo counter incremented whenever they run the program. Then when I want to reset the democount for the next user it is already setting at zero, (the initial value), so I can't change it. What now?
pgabell  Saturday, November 14, 2009 7:30 PM
And to answer your deployment question ... no the file is not deployed with your application. The idea is that these are user settings ... so there would be no initial value.

Visual Studio automatically creates this file for you for each use when the user uses the application and the application saves the settings.

Hope this helps.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Marked As Answer bypgabell Sunday, November 15, 2009 10:52 PM
  •  
DeborahK  Sunday, November 15, 2009 4:43 PM
why reset the values for the next user?

if you create these settings, and put their scope = User, then each user will have their own settings.

Unless I'm missing something here...

as far as the value changing, yes they do, but if you go into the properties and look, it shows the initial value. the value for that user is kept in a settings file as xml.
jwavila  Sunday, November 15, 2009 2:15 AM
OK, great. Thanks for the info. As I undersatnd you, the actual modified settings are stored in an xml file. Correct? When you deploy your program is this file included? Also, can you tell me the directory where this file is stored and what naming convention should I look for?
pgabell  Sunday, November 15, 2009 1:30 PM
this article goes over some of the settings info

It tells where it is stored, but there is no naming convention - at least not that makes sense to us

http://visualbasic.about.com/od/usingvbnet/a/appsettings_4.htm
jwavila  Sunday, November 15, 2009 3:51 PM
And to answer your deployment question ... no the file is not deployed with your application. The idea is that these are user settings ... so there would be no initial value.

Visual Studio automatically creates this file for you for each use when the user uses the application and the application saves the settings.

Hope this helps.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Marked As Answer bypgabell Sunday, November 15, 2009 10:52 PM
  •  
DeborahK  Sunday, November 15, 2009 4:43 PM
Thank you I appreciate your help!
pgabell  Sunday, November 15, 2009 10:52 PM

You can use google to search for other answers

Custom Search

More Threads

• Intellisense not going to correct position?
• Add New Item on Project Menu Hangs Visual Basic 2008 Express
• custom a Toolstrip
• XML Documentation Comments not working.
• ContextSwitshDeadlock pain in the rear
• Visual Studio 2008 - Find button
• ToolStripMenuItem - Checked/CheckState differences
• Help... Can't get .vb file to open in Designer mode
• can't edit stored procedure from vs.net 2003
• Setup Debgging for web app