Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
117 views
in Technique[技术] by (71.8m points)

.net - What happens after settings update

When we install the new version of our app (in my case, office add-in), the new settings folder is created in a new path with new version number. We can update our settings calling Settings.Default.Upgrade()

I wonder - what will happen if for example, in the version 1.0 I had the following settings (setting names):

Name
Color
Font

And in version 1.1 I decided to not use some settings anymore in my app and I added new ones, so the new setting file (default) has the following settings names:

Name
Font_Color
Font_Style

If I decide to call Settings.Default.Upgrade() what will happen with my settings file? All settings will be merged and some settings (in my case, Color and Font) won't be used? I am trying to predict potential future changes to my settings and I wonder what will happen if I decide to add or remove certain entries. New, upgraded config file will consist of all previous settings (if upgraded) but my app will simply not use them?

I expect that the file after upgrade would consist of the following settings:

Name
Color (not used anymore)
Font (not used anymore)
Font_Color
Font_Style

Am I right or upgrade works different in regards to added/deleted settings? Should I delete old, unused settings or simply let them be? What is the best practice in this case?

question from:https://stackoverflow.com/questions/65601767/what-happens-after-settings-update

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...