Search code examples
uwpdesktop-bridge

Windows Forms to UWP app via Desktop Bridge - User Settings are lost/reset on UWP app Upgrade


I have converted my Windows Forms (desktop) app to UWP using the latest iteration of the Desktop Bridge (via a Packaging Project in Visual Studio 2017) and am now testing the UWP install and upgrade processes for my app. When my app was deployed via the prior methodology (ClickOnce / .MSI / Windows Installer) my User Settings (preferences) were properly migrated and preserved when my app was upgraded to a later version. Under UWP all User Settings are lost/reset on upgrade. My issue is the same issue that was described in this thread (for which no resolution was provided):

Here is the prior thread I found, same issue, no resolution

Any ideas on how to properly preserve User Settings for a Desktop app brought to UWP via the Desktop Bridge?

Thanks!


Solution

  • Store the data in ApplicationData.LocalSettings.

    https://learn.microsoft.com/en-us/windows/uwp/design/app-settings/store-and-retrieve-app-data