Skip to content

Commit d61637f

Browse files
Fix misleading claim that RoamingSettings persists through Store updates (#6654)
* Fix misleading claim that RoamingSettings persists through Store updates The documentation stated 'The system also preserves the contents of these data stores when the user installs an update to your app' — but RoamingSettings does not reliably persist through Microsoft Store updates (reported in #5669). Changes: - store-and-retrieve-app-data.md: Soften blanket guarantee to 'generally preserves' with explicit callout linking to the Roaming data section; add note to LocalSettings section that it reliably persists through updates; add IMPORTANT callout in Roaming data section warning about Store update data loss - settings-learning-track.md: Add 'reliably persist through app updates' to LocalSettings bullet; add inline warning to RoamingSettings bullet Closes public issue #5669 Co-authored-by: Copilot <[email protected]> * Address Copilot review feedback - Move inline **Important** warning to proper [!IMPORTANT] callout after the API list in settings-learning-track.md, consistent with Learn markdown patterns used elsewhere - Add 'windows 11' to keywords in settings-learning-track.md - Narrow 'For reliable data persistence' to 'For settings that must survive app updates' in store-and-retrieve-app-data.md to avoid implying LocalSettings covers files (it only covers settings) Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 1bae4b6 commit d61637f

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

hub/apps/develop/data/store-and-retrieve-app-data.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ Use files to store binary data or to enable your own, customized serialized type
4242
## Storing app data in the app data stores
4343

4444

45-
When an app is installed, the system gives it its own per-user data stores for settings and files. You don't need to know where or how this data exists, because the system is responsible for managing the physical storage, ensuring that the data is kept isolated from other apps and other users. The system also preserves the contents of these data stores when the user installs an update to your app and removes the contents of these data stores completely and cleanly when your app is uninstalled.
45+
When an app is installed, the system gives it its own per-user data stores for settings and files. You don't need to know where or how this data exists, because the system is responsible for managing the physical storage, ensuring that the data is kept isolated from other apps and other users. The system generally preserves the contents of these data stores when the user installs an update to your app, though RoamingSettings may not persist through Microsoft Store updates (see [Roaming data](#roaming-data)). For settings that must survive app updates, use LocalSettings. The system removes the contents of these data stores completely and cleanly when your app is uninstalled.
4646

4747
Within its app data store, each app has system-defined root directories: one for local files, one for roaming files, and one for temporary files. Your app can add new files and new containers to each of these root directories.
4848

4949
## Local app data
5050

5151

52-
Local app data should be used for any information that needs to be preserved between app sessions and is not suitable for roaming app data. Data that is not applicable on other devices should be stored here as well. There is no general size restriction on local data stored. Use the local app data store for data that it does not make sense to roam and for large data sets.
52+
Local app data should be used for any information that needs to be preserved between app sessions and is not suitable for roaming app data. Data that is not applicable on other devices should be stored here as well. There is no general size restriction on local data stored. Use the local app data store for data that it does not make sense to roam and for large data sets. Local app data reliably persists through app updates, making LocalSettings the recommended choice for user preferences and app state that must survive Microsoft Store updates.
5353

5454
### Retrieve the local app data store
5555

@@ -152,6 +152,9 @@ async void ReadTimestamp()
152152
> Roaming data and settings is [no longer supported as of Windows 11](/windows/deployment/planning/windows-10-deprecated-features).
153153
> The recommended replacement is [Azure App Service](/azure/app-service/). Azure App Service is widely supported, well documented, reliable, and supports cross-platform/cross-ecosystem scenarios such as iOS, Android and web.
154154
155+
> [!IMPORTANT]
156+
> RoamingSettings data may not persist through Microsoft Store app updates even on Windows 10. For settings that must survive app updates, use [LocalSettings](/uwp/api/windows.storage.applicationdata.localsettings) instead.
157+
155158
## Temporary app data
156159

157160

uwp/get-started/settings-learning-track.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Save and load settings in a UWP app
33
description: Learn how to save and load app settings in Universal Windows Platform apps.
44
ms.date: 05/07/2018
55
ms.topic: how-to
6-
keywords: get started, uwp, windows 10, learning track, settings, save settings, load settings
6+
keywords: get started, uwp, windows 10, windows 11, learning track, settings, save settings, load settings
77
ms.localizationpriority: medium
88
ms.custom: RS5
99
---
@@ -23,11 +23,14 @@ The following data types can be used with settings: integers, doubles, floats, c
2323

2424
Here are the main APIs you need to know about to save or load app settings:
2525

26-
- [Windows.Storage.ApplicationData.Current.LocalSettings](/uwp/api/Windows.Storage.ApplicationData#Windows_Storage_ApplicationData_LocalSettings) gets the application settings container from the local app data store. Settings stored here are kept on the device.
26+
- [Windows.Storage.ApplicationData.Current.LocalSettings](/uwp/api/Windows.Storage.ApplicationData#Windows_Storage_ApplicationData_LocalSettings) gets the application settings container from the local app data store. Settings stored here are kept on the device and reliably persist through app updates.
2727
- [Windows.Storage.ApplicationData.Current.RoamingSettings](/uwp/api/windows.storage.applicationdata.roamingsettings#Windows_Storage_ApplicationData_RoamingSettings) gets the application settings container from the roaming app data store. Settings stored here no longer roam (as of Windows 11), but the settings store is still available. The recommended replacement for RoamingSettings is [Azure App Service](/azure/app-service/). Azure App Service is widely supported, well documented, reliable, and supports cross-platform/cross-ecosystem scenarios such as iOS, Android and web.
2828
- [Windows.Storage.ApplicationDataContainer](/uwp/api/windows.storage.applicationdatacontainer) is a container that represents app settings as key/value pairs. Use this class to create and retrieve setting values.
2929
- [Windows.Storage.ApplicationDataCompositeValue](/uwp/api/Windows.Storage.ApplicationDataCompositeValue) represents multiple app settings that should be serialized as a unit. This is useful when one setting shouldn't be updated independently of another.
3030

31+
> [!IMPORTANT]
32+
> RoamingSettings may not persist through Microsoft Store app updates. For settings that must survive app updates, use [LocalSettings](/uwp/api/Windows.Storage.ApplicationData#Windows_Storage_ApplicationData_LocalSettings) instead.
33+
3134
## Save app settings
3235

3336
For this introduction, we will focus on two simple scenarios: saving and loading a simple app setting, and saving and loading a composite font/font size setting.

0 commit comments

Comments
 (0)