0

I have an application using WPF .NET6 and packaging with MSIX. The application is deployed at a network share drive.

There are default settings build in the application but user will save individual user settings. I am trying to keep the user settings for each software update.

I find some similar questions for WPF clickonce application, but none of the solutions seems working for me. The user settings are overwritten with default settings on every software updates.

Keep user's settings after altering assembly/file version

Settings.Default.Upgrade() does not keep current settings

For example, I added thoes lines to app() on start up. But it does not work.

// Copy user settings from previous application version if necessary
if (MyApp.Properties.Settings.Default.UpdateSettings)
{
    MyApp.Properties.Settings.Default.Upgrade();
    MyApp.Properties.Settings.Default.UpdateSettings = false;
    MyApp.Properties.Settings.Default.Save();
}

So with MSIX package, how to keep the current user settings on each software update?

Owen Lee
  • 349
  • 1
  • 5
  • 19
  • 1
    You could serialise your values to a fixed folder in localappdata rather than using the settings mechanism. – Andy Jan 12 '23 at 21:00
  • Yes. This could be my last option if there is no better solution. – Owen Lee Jan 13 '23 at 13:29
  • I would say appdata should be your first option, rather than your last. App data. Settings is data. And it's for your app. Clue is there in the name. – Andy Jan 13 '23 at 13:33

0 Answers0