Ilya Klementiev
Ilya Klementiev

Reputation: 593

Why RoamingSettings clears after app update?

I using sample https://mytoolkit.svn.codeplex.com/svn/WinRT/Storage/ApplicationSettings.cs for manage my app settings.

Save settings login to roaming:

ApplicationSettings.SetSetting("login", "qwe123", true);

Read setting login from roaming:

ApplicationSettings.GetSetting<string>("login", true)

Why my roaming setting login is empty when app update?

For example in app version 2.0.0.0 roaming setting login= "qwe123", but when i update my app to version 3.0.0.0 roaming setting login = ""

Upvotes: 0

Views: 87

Answers (1)

Hans Passant
Hans Passant

Reputation: 941327

This is by design. The path where the file data is stored includes the version number of your application.

Take a look at the ApplicationData.SetVersionAsync() method, specifically intended to solve this problem. Only use it when you can ensure that a new version of your program won't fall over when it reads the old data.

Upvotes: 1

Related Questions