Settings.Default.Upgrade does not copy over the user settings to new release

Dinh Ton 1 Reputation point


I'm writing a console app in Winform with Visual Studio 2019. I want the user settings to persist every time I release a new version. I'm using this piece of code to do that.

            if (Properties.Settings.Default.UpgradeRequired)
                Properties.Settings.Default.UpgradeRequired = false;

However, the settings are reverted back to the default values every time. In addition, I noticed that my app installation folder changes for every release (the HASH part) and the version number is not included. For example, this is what the path looks like.


I did sign the ClickOnce manifests with a Test certificate. I also set the version number to increase automatically every release. (Please ask me if you need more information regarding my project properties).

Please help me with this issue. Thanks in advance.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,320 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,412 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,950 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 29,236 Reputation points Microsoft MVP


    If these instructions don't help consider the following but when don't just try this first solution, read through the article.

    Take a look at the following Microsoft Installer project in place of ClickOnce. You set the path e.g. C:\Program Files (x86)\PayneSoftware\SomeApplication.

    There is documentation to read before trying.

    We used this installer with signing and a local SQL-Server database.

    Can't speak about app.config with settings done conventionally, ours are done using appSetting section and after four years never had a need to add or remove settings.

    We use VeriSign for signing.

    So the above is an alternative to ClickOnce.