ApplicationData.localSettings 会在应用更新时被清除吗?

Do ApplicationData.localSettings get cleared when the app gets updated?

我正在开发现代 Windows 8 应用程序,想弄清楚 Windows.Storage.ApplicationData.current.localSettings (msdn doc is here) 是否在商店更新应用程序时得到清理。

这些设置会在应用程序更新时保留,就像 roamingSettings 和 localFolder、roamingFolder 和 tempFolder 的内容一样。换句话说,执行应用程序更新不会影响任何应用程序数据状态,当您认为许多更新都是小错误修复并且不应该至少需要重置或迁移现有状态时,这是非常有意义的。

请注意,卸载 应用程序然后重新安装它会清除 localSettings、localFolder 和 tempFolder。 roamingSettings 和 roamingFolder 将被恢复,前提是用户在某个合理的时间段内(未指定,但大约 30 天)将应用程序安装在另一台设备上。

通过 ApplicationData.setVersionAsync, and that an app update can choose, if it wants to migrate appdata from one version to another. Examples can be found in the Application Data sample 知道应用程序状态有自己的版本控制方案也很好。

不,您的本地设置将在应用程序更新之间保留。