473,796 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Settings don't persist

I was dissapointed to see that the new Settings system in 2005 doesn't
appear to persist the data between application sessions. I understand that
it is used for application initialization, but there is something I read
that made me think it would work for user settings as well. Is there an
option I need to switch somewhere to get these to persist or is it back to
serializing my own options class to XML?

Thanks,
Steve
Mar 2 '06 #1
5 1413
Somewhere in your code you have to call the Save() method... e.g.
Preferences.Def ault.Save();

HTH
Mark

"Steve" wrote:
I was dissapointed to see that the new Settings system in 2005 doesn't
appear to persist the data between application sessions. I understand that
it is used for application initialization, but there is something I read
that made me think it would work for user settings as well. Is there an
option I need to switch somewhere to get these to persist or is it back to
serializing my own options class to XML?

Thanks,
Steve

Mar 2 '06 #2

"StealthyMa rk" <St**********@d iscussions.micr osoft.com> wrote in message
news:89******** *************** ***********@mic rosoft.com...
Somewhere in your code you have to call the Save() method... e.g.
Preferences.Def ault.Save();


That is exactly what I was looking for, thank you! Weird this is, the docs
say that it will create a AppName.exe.con fig file to hold the settings (if
using the default provider) and it also says this file will be created in
teh same located as the executable that created it. Weird thing is... I
don't have that file! But the settings are saved.... so weird. A google
desktop search didn't find it either, so I don't know where that file is.

Anyway, thanks again for the post,
Steve
Mar 2 '06 #3
On Wed, 1 Mar 2006 17:01:48 -0800, Steve wrote:
"StealthyMa rk" <St**********@d iscussions.micr osoft.com> wrote in message
news:89******** *************** ***********@mic rosoft.com...
Somewhere in your code you have to call the Save() method... e.g.
Preferences.Def ault.Save();


That is exactly what I was looking for, thank you! Weird this is, the docs
say that it will create a AppName.exe.con fig file to hold the settings (if
using the default provider) and it also says this file will be created in
teh same located as the executable that created it. Weird thing is... I
don't have that file! But the settings are saved.... so weird. A google
desktop search didn't find it either, so I don't know where that file is.


I don't know how the 2005 settings system works but i would suppose that
the settings file is actually created in the user IsolatedStoarag e for the
application. It would not make any sense to me to store user settings
beside the executable since users are often not allowed to write in this
folder.
Mar 2 '06 #4
Well, the *initial* (default) settings *are* read from the config file, but
afterwards the settings are persisted to either of three locations, depending
on the properties of the specific setting.
You can set the scope to User or Application, and there is an
SettingsManagea bility attribute, which controls whether the setting is stored
in the domain profile for the user. It cannot be set using the designer(?).

Mark

"Steve" wrote:

"StealthyMa rk" <St**********@d iscussions.micr osoft.com> wrote in message
news:89******** *************** ***********@mic rosoft.com...
Somewhere in your code you have to call the Save() method... e.g.
Preferences.Def ault.Save();


That is exactly what I was looking for, thank you! Weird this is, the docs
say that it will create a AppName.exe.con fig file to hold the settings (if
using the default provider) and it also says this file will be created in
teh same located as the executable that created it. Weird thing is... I
don't have that file! But the settings are saved.... so weird. A google
desktop search didn't find it either, so I don't know where that file is.

Anyway, thanks again for the post,
Steve

Mar 2 '06 #5
Hi Mark,

I will look into the SettingsManagea bility attribute. I'm not sure what a
"domain profile" is, but I will learn.

Thanks for the information.
Have a great weekend!
Steve
"StealthyMa rk" <St**********@d iscussions.micr osoft.com> wrote in message
news:82******** *************** ***********@mic rosoft.com...
Well, the *initial* (default) settings *are* read from the config file,
but
afterwards the settings are persisted to either of three locations,
depending
on the properties of the specific setting.
You can set the scope to User or Application, and there is an
SettingsManagea bility attribute, which controls whether the setting is
stored
in the domain profile for the user. It cannot be set using the
designer(?).

Mark

"Steve" wrote:

"StealthyMa rk" <St**********@d iscussions.micr osoft.com> wrote in message
news:89******** *************** ***********@mic rosoft.com...
> Somewhere in your code you have to call the Save() method... e.g.
> Preferences.Def ault.Save();


That is exactly what I was looking for, thank you! Weird this is, the
docs
say that it will create a AppName.exe.con fig file to hold the settings
(if
using the default provider) and it also says this file will be created in
teh same located as the executable that created it. Weird thing is... I
don't have that file! But the settings are saved.... so weird. A
google
desktop search didn't find it either, so I don't know where that file is.

Anyway, thanks again for the post,
Steve

Mar 3 '06 #6

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

Similar topics

1
2013
by: David Veeneman | last post by:
How do I persist properties bound to application settings in the VS 2005 Designer? I am binding form and control properties to application settings using VS 2005, as explained in MSDN: http://msdn2.microsoft.com/en-us/library/wabtadw6 Everything works fine, except my properties won't persist. The MSDN article explains that "in languages other than Visual Basic, you must explicitly
8
1475
by: Glenn Thimmes | last post by:
I am needing to read and write application settings from within my ASP.NET application. My web.config is not an option since I need to be able to write settings as well. My database is not an option either as the database location itself is one of the settings. I've been trying to work with Isolated Storage, but it is obviously designed to be use specific. I've attempted using Impersonation to load the same settings for every session,...
3
3183
by: Jon Slaughter | last post by:
I wrote an app that needed to save settings such as colors, fonts, etc... after hours of trying to use ConfigurationManager and AppSettings along with a few other things I finally found that I could just use global::Properties.xxx.Settings.Default.yyy where xxx is the namespace and yyy is a setting created in the settings dialog. This is an extremly easy way to save and restore properties but I'm wondering how general it is and if its...
4
2651
by: Richard Lewis Haggard | last post by:
I have an application that can't use the registry to save various user options and application settings. My first thought was to simply use an application configuration file but this approach seems flawed. The app config file appears to be updated with values while the application is running but when the application closes, the file seems to get restored to a pristine state and the accumulated user options and application settings are...
0
2853
by: =?Utf-8?B?UmljayBHbG9z?= | last post by:
For some unknown reason (user error?), I cannot get a NameValueCollection to persist in the app.config file. Unlike other settings, I cannot get the String Collection Editor GUI to allow my to add/edit any values for a setting with type NameValueCollection. Nor can I get a NameValueCollection to persist to the User Settings via code using a simple C# Console App... Is this a user error or ?
2
8345
by: Paul Hadfield | last post by:
Hi, I'm not having a lot of luck googling for this one, I want to be able to store a custom class in the user settings (DotNet2.0, win app). I don't wish to create public get / set properities for all the things I want to persist just for storing in the user settings file (because that would allow other apps to access / change data they shouldn't be able to). I understand how to browse to the object in VS2005 to add an entry to the...
1
8623
by: Robert Dufour | last post by:
Changing a setting in the UserSettings from within my app using code (Vs2005 vb.net) does not seem to persist changes to the myapp.exe.config file what is the location and name of the file where the usersettings are persisted? Is there any way to have modifications made in code to application level settings? The my.settings in VS2005 and vb.net 2005 does not permit application level settings to be modified in code cause the geniuses at MS...
2
10066
by: =?Utf-8?B?QWFyb24=?= | last post by:
I am trying to create dynamic settings in a .NET 2.0 C# application. I need to be able to store settings on the user, but I do not know how many settings are necessary at design time because the settings are determined by a business object that is loaded into the app of which there could be one or many. I would prefer to use the same LocalFileSettingsProvider that the settings default to so that I do not have to manage it myself. Here...
5
1811
by: Steve Barnett | last post by:
I added some user settings to my app which caused the Settings.settings to be generated etc... and all was well and lovely and the Sun was shining. Then I changed the version number of my assembly (it had been updated, after all) and all of my settings disappeared, which was somewhat less than lovely and the clouds came rolling in. I gather the user.config file that the Properties.Settings class saves is assembly version specific. Is...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10465
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.