473,699 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Settings

I added some user settings to my app which caused the Settings.settin gs 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.Sett ings class saves is
assembly version specific. Is there any way to override that so I can retain
the settings across all versions of my app?

Thanks
Steve
Dec 13 '07 #1
5 1799
Is it that no one uses the generated Settings class and user.config file?

Perhaps I'm wasting my time with this feature?

Anyone have an opinion?

Steve

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ec******** ******@TK2MSFTN GP03.phx.gbl...
>I added some user settings to my app which caused the Settings.settin gs 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.Sett ings class saves is
assembly version specific. Is there any way to override that so I can
retain the settings across all versions of my app?

Thanks
Steve

Dec 18 '07 #2
On Tue, 18 Dec 2007 05:14:50 -0800, Steve Barnett <no****@nodomai n.com>
wrote:
Is it that no one uses the generated Settings class and user.config file?

Perhaps I'm wasting my time with this feature?

Anyone have an opinion?
I use it all the time. But I don't have the requirement to preserve the
settings across updates of my programs, so I've never actually had to
solve the problem you're asking about.

I can't speak for everyone else, but just because you haven't received a
response to your question, that doesn't mean no one's using the feature.
At best, it means no one's trying to use it the way you want to use it.

That said, I suspect there _is_ a solution to your problem. I think the
Settings class would be much less useful if users had to start from
scratch every time the program was updated. I just don't happen to know
what that solution is. Sorry...

Pete
Dec 18 '07 #3
Hi Steve,

I use User Setting quite often, but have never tried to deal with the issue
of persisting settings across versions of the application. I suspect that
the best way to do this would be to use the System Registry for such
settings, as it is in a well-known location that will not change, and will
persist the settings as long as either your application or the user removes
them.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ep******** ******@TK2MSFTN GP02.phx.gbl...
Is it that no one uses the generated Settings class and user.config file?

Perhaps I'm wasting my time with this feature?

Anyone have an opinion?

Steve

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ec******** ******@TK2MSFTN GP03.phx.gbl...
>>I added some user settings to my app which caused the Settings.settin gs 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.Sett ings class saves is
assembly version specific. Is there any way to override that so I can
retain the settings across all versions of my app?

Thanks
Steve


Dec 19 '07 #4
My concern over using the registry or well know locations was with Vista
security. I was unsure as to what it may or may not limit me to. Similarly,
what about security policies that system administrators put in place. The
user settings seemed to be a safe (Microsoft) way round this.

What I've done for now is throw together my own class to wrap "ini" file
functionality using an xml file. It allows me to control where the file goes
and what it's called and I don't need to worry about application version
numbers. I've used a "well known location" and am just hoping it won't get
locked down by Vista. (It's the users Application Data folder - since, on
reflection, I'm saving application data - folder locations - rather than
pure user data.).

I sacrifice strong typing using this method, but you can't have everything.

Thanks
Steve

"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:uR******** ******@TK2MSFTN GP02.phx.gbl...
Hi Steve,

I use User Setting quite often, but have never tried to deal with the
issue of persisting settings across versions of the application. I suspect
that the best way to do this would be to use the System Registry for such
settings, as it is in a well-known location that will not change, and will
persist the settings as long as either your application or the user
removes them.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ep******** ******@TK2MSFTN GP02.phx.gbl...
>Is it that no one uses the generated Settings class and user.config file?

Perhaps I'm wasting my time with this feature?

Anyone have an opinion?

Steve

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ec******* *******@TK2MSFT NGP03.phx.gbl.. .
>>>I added some user settings to my app which caused the Settings.settin gs
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.Sett ings class saves
is assembly version specific. Is there any way to override that so I can
retain the settings across all versions of my app?

Thanks
Steve



Dec 19 '07 #5
Hi Steve,

Considering your decision regarding approach, you could still use User
Settings. All you would have to do is to copy the existing User Settings to
your installation Settings file. It is, after all, just an XML file
containing a serialized class.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Steve Barnett" <no****@nodomai n.comwrote in message
news:Oo******** *****@TK2MSFTNG P06.phx.gbl...
My concern over using the registry or well know locations was with Vista
security. I was unsure as to what it may or may not limit me to.
Similarly, what about security policies that system administrators put in
place. The user settings seemed to be a safe (Microsoft) way round this.

What I've done for now is throw together my own class to wrap "ini" file
functionality using an xml file. It allows me to control where the file
goes and what it's called and I don't need to worry about application
version numbers. I've used a "well known location" and am just hoping it
won't get locked down by Vista. (It's the users Application Data folder -
since, on reflection, I'm saving application data - folder locations -
rather than pure user data.).

I sacrifice strong typing using this method, but you can't have
everything.

Thanks
Steve

"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:uR******** ******@TK2MSFTN GP02.phx.gbl...
>Hi Steve,

I use User Setting quite often, but have never tried to deal with the
issue of persisting settings across versions of the application. I
suspect that the best way to do this would be to use the System Registry
for such settings, as it is in a well-known location that will not
change, and will persist the settings as long as either your application
or the user removes them.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ep******* *******@TK2MSFT NGP02.phx.gbl.. .
>>Is it that no one uses the generated Settings class and user.config
file?

Perhaps I'm wasting my time with this feature?

Anyone have an opinion?

Steve

"Steve Barnett" <no****@nodomai n.comwrote in message
news:ec****** ********@TK2MSF TNGP03.phx.gbl. ..
I added some user settings to my app which caused the Settings.settin gs
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.Sett ings class saves
is assembly version specific. Is there any way to override that so I
can retain the settings across all versions of my app?

Thanks
Steve



Dec 20 '07 #6

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

Similar topics

3
5022
by: pealy2 | last post by:
Sorry if this is in the wrong group, I've searched long & hard without finding anything even slightly useful. (recommendations for a more relevant group gratefuly received) I need to change the settings for the default web service user account so that sounds go through a sound card rather than the on-board sound. I can do this simply when I'm logged in to my own user account by going through control panel. If I can't log on as the Web...
7
2438
by: Bit Twiddler | last post by:
Hi, I have a windows form app which would benefit from the new application settings support in VS2005. Say that my form has a single textbox on it. When the form closes I would like to save the text in that textbox as part as the user level application settings. When the application restarts I would like that text to be restored to the textbox.
2
9709
by: Shane | last post by:
Does anyone know how to add user scoped settings to My.Settings at runtime? I know how to use the 'My Settings' designer to add user settings at design time. I also, know how to create a class that inherits from the ApplicationSettingsBase where you can define your own settings with their default values, at design time. But, these are all done at design time which aint want i need. I've tried using the My.Settings.Properties.Add...
2
2127
by: John | last post by:
I have a Win app in C#. I want to save the data the user enterere into textboxes and the selections the user made to comboboxes when the user close the app. So next time when the user launches the app, he can see the data he entered before. How can I do this? Thanks.
4
3587
by: RedHair | last post by:
I developed a Win form with VS.NET 2005 + .NET 2.0 in C# There are some application settings are "User" scope and stored in xxx.settings, I can access them via Settings class and changethem with Settings.Save(); However, if I change and save them then my app will read the change from the user.config , my question is how to access the original default setting?
9
2365
by: =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post by:
I have an app that prints entry tickets. If the printer driver is not set up exactly to detect the black mark on the back of the ticket, the tickets do not print correctly. Because of this, all users are logging on with the same user name to ensure they get a correctly configured printer driver. The application runs on a Terminal Server via the RDP client. In order to audit the actions of users, it is necessary to identify each user....
1
8598
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...
3
4061
by: Piotrekk | last post by:
Hi I have a problem connected with user.config file. I am using default settings.settings . To settings.settings I am adding one user scope string and one application scope string. Thus app.config file is added to my project. When I build and run the project app.exe.config file is created and added to application base directory. This file contains two strings added previously. Q1: No user.config file is created in my documents and...
1
4842
by: =?Utf-8?B?VGVycnk=?= | last post by:
I am using the My.Settings object to save user settings. During testing, I want to 'zero' out what has been saved to start with the defaults again. Where doies the framwork actually persist these user settings? TIA, -- Terry
0
8689
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
8618
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
9178
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
9035
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
8885
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2010
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.