473,658 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

My.Settings.Upg rade doesn't upgrade?

Hi all,

In my VB 2005 project I create a setting called UpgradeRequired with a
default value of True, and I include the following code that runs when the
project is launched:

If My.Settings.Upg radeRequired Then
My.Settings.Upg rade()
My.Settings.Upg radeRequired = False
My.Settings.Sav e()
End If

This code should allow a user to run one version of my app which saves
settings, then run a newer version of the app and automatically have the
saved settings applied to the newer version of the app. But (as you guessed
by the fact that I'm posting this question) it's not working. When I run
the newer version of my app I just get the default values for all of the
settings.

To try to get to the bottom of this, I need to understand what magic
My.Settings.Upg rade uses to determine if there was a previous version of the
app settings. I notice that the persistence mechanism creates a user.config
file in a new application folder for each new version of my app:

My Profile
Application Data
My Company
MyApplication.e xe_Url_abcdefg
1.0.0.0
MyApplication.e xe_Url_hijklmn
1.1.0.0

However, when I create simple test program that does the same thing, and
just change the file and assembly version numbers between runs, it puts both
"version" folders under the same application folder:

My Profile
Application Data
My Company
MyApplication.e xe_Url_gibberis h
1.0.0.0
1.1.0.0

So, something that I am doing when I build and install my application in a
production environment is causing the My.Settings magic to think that what
newer versions of my application are a totally different application.

My application consists of a main program and a bunch of strong name signed
DLLs, all of which share the same assembly and file version strings. Each
time I create a new version of my application I create a new, higher version
number and rebuild the whole kit and caboodle with that new version number
baked into all of the assemblies.

One other thing I'm doing is this: Each of the DLLs has its own user-scoped
settings (maintained in the magic My Project -Settings designer). This
seems to work as expected; each assembly "sees" its own settings via
My.Settings.<Se ttingName>, and all of the settings are persisted in separate
sections of the user.config file.

TIA - Bob
Nov 15 '08 #1
3 6810
It turns out that there is one more crucial point that I didn't think of:
Each new release of my app is installed into a different folder! (We have a
requirement to be able to have multiple versions of the app installed
side-by-side.) So, the My.Settings magic probably considers each new
release a different app because it comes from a different location.

That leaves me with the question of how to tell My.Settings that it should
consider any version of my app to be the same app even if its location has
changed. Is that possible?

TIA - Bob

Nov 15 '08 #2
Thanks Hongye, signing my application solved my problem!

Bob
Nov 17 '08 #3
You are welcome, Bob. I am glad that my suggestion helps you.

Have a nice day.

Regards,
Hongye Sun (ho*****@online .microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.
*

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '08 #4

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

Similar topics

2
1859
by: Tappy Tibbons | last post by:
Have many of you upgraded to VS 2003? We have been using Visual Studio 2002, and are somewhat satisfied, except for the following areas: Speed - VS2002 apps are dead dog slow to start up, and slow the first time a form loads. Has this been addressed? We have been all through the "fixes" that supposedly speed up things in 2002, but they do not work, and are hoping 2003 is better.
4
1981
by: Dave Harney | last post by:
Hi Newsgroup, I'm currently using VS Ver 7.0.9466 with an OS of Server 2000 (domain controller) Ver 5.0.2195 (Build 2195) SP4. I have MSDN Universal and would like to upgrade my development environment ot Server 2003 and VS 2003 Do I need to start from scratch, or will can I use Server 2003 as a simple upgrade to my existing OS?
3
1919
by: John | last post by:
Hello, I am trying to figure out how to determine if I have fixed an upgrade warning. If I delete the green text then the upgrade warning goes away. However, I would expect it to come back after I rebuild if I haven't changed any of the code. Can anyone clarify what actions to take with the upgrade warnings? Thanks
3
24532
by: davepkz | last post by:
I have a basic question about managing user.config settings: In my C# app, I save the user's preferences to the config file. But each time I release a new build of the app, something in .NET creates a new folder (named for the build number) in Documents And Settings. The result is the users lose all their settings and have to start over. What is the standard way to allow users to maintain their settings when they get a new version of...
2
1291
by: Graham Charles | last post by:
Since the .config file that contains the values in My.Settings is saved to... %USERPROFILE%\Local Settings\Application Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison> ....that implies that if I update the AssemblyVersionAttribute (make a new build, say), my users' configuration files will no longer be valid. Does that sound right? Seems like an odd default behavior. I suppose I could manually copy the .config file during the...
3
4946
by: David Cartwright | last post by:
Hi all, Apologies if this is a FAQ - I've searched all the groups I can think of, though. I've written a VB.NET application and an associated Installer project in Visual Studio 2005. My.Settings works just great, but the problem is that when I produce a new version of the application, the My.Settings user-related settings are lost - presumably because they're saved in the version-specific application data directory and so when a new...
3
2559
by: Tsahi Asher | last post by:
hi, i was trying to save the window size of my app using the generated Settings class of Visual C# 2005 Express. for some reason, the stored size was bigger from the actual size, so each time i start the app, it's bigger than before, until it fills the screen (1024*768). the odd thing is, that it works just fine in the IDE, and if i install it on a different computer, and even if i use the executable produced by the IDE instead of the one...
7
3307
by: Just_a_fan | last post by:
I save some data to an array in my program. I can reopen the setting screen and see that the data is, in fact, in the array. I then do a lot of these: My.Settings.Brkr1 = BreakerAmps(1) My.Settings.Brkr2 = BreakerAmps(2) My.Settings.Brkr3 = BreakerAmps(3) My.Settings.Brkr4 = BreakerAmps(4) My.Settings.Brkr5 = BreakerAmps(5)
13
1876
by: John | last post by:
Our technical guy says that our linux server is running PHP 4. I thought we were running 5 already. He says he wants to charge us £500 a year to install and support it because it is a lot of work, and the problems it will create on our current systems are huge etc. Now I installed 5 on my PC at home running Apache without any problems and develop sites locally and then upload to the server (running 4). I have never had a problem with...
0
8330
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
8850
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
8746
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...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
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...
1
6178
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
5649
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
2749
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
1737
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.