Hi, Daniel
Thanks for your feedback.
I did a test in a small console application, following are the steps:
1. Uncomment the AssemblyVersion("1.0.*")] and Comment [assembly: AssemblyVersion("1.0.0.0")] in AssemblyInfo.cs.
2. Add a setting “TestText”—String—User--"InitialText?in the setting designer.
3. Code like below:
| Properties.Settings.Default.Version="changed"; |
| Properties.Settings.Default.Save(); |
| Console.WriteLine("Theversionis{0}",Properties.Settings.Default.Version); |
Run this code and the result is: “The text is: ChangedText?
4. Change the code like below:
| //Properties.Settings.Default.TestText=“ChangedText? |
| //Properties.Settings.Default.Save(); |
| Console.WriteLine(“Thetextis:{0}?Properties.Settings.Default.TestText); |
Of course this time the result is: “The text is: InitialText?
5. Change the code like below:
| //Properties.Settings.Default.TestText=“ChangedText? |
| //Properties.Settings.Default.Save(); |
| Properties.Settings.Default.Upgrade(); |
| Console.WriteLine(“Thetextis:{0}?Properties.Settings.Default.TestText); |
At this time, the result is: “The text is: ChangedText? the Upgrade() works well.
I don’t know what’s your code logic looks like, and I assume, maybe somewhere in your code change the settings but forget to use Save(), because the Upgrade() revert the settings to the last saved values, so the application give you a set of strange settings that you make no sense about them, and they were saved inanold version. Without looking your code, I just guessing around, hope can help you.
Sincerely!
Please mark the replies as answers if they help and unmark them if they provide no help.