Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic user-settings upgrade #178

Open
simmotech opened this issue Dec 17, 2021 · 2 comments
Open

Automatic user-settings upgrade #178

simmotech opened this issue Dec 17, 2021 · 2 comments
Assignees

Comments

@simmotech
Copy link

If I understand correctly, configuration files for user settings used to be automatically migrated when a ClickOnce app was updated.
This seems to be no longer the case for .NET 6.

Solutions on the web talk about using MyApp.Properties.Settings.Default.Upgrade() but this didn't work for me and looking at code in LocalFileSettingsProvider showed why: it was designed only to support a directory structure where each Version's settings were stored in a folder of the Version's name and moving to the parent directory allowed previous Versions to be found.
But since ClickOnce apps are effectively different apps, this can't work.

Where is the code that used to do the automatic settings upgrade?

This is the last piece in the puzzle for me in getting ClickOnce to work fully under .NET 6.

@dckorben
Copy link

I have the same issue with moving to higher versions of .NET along with #74 . Alot of this is likely all interrelated.

@thehill383
Copy link

I would like to add some knowledge that i have built up as a result of recently converting a large application from .Net 4.8 to .Net 8.0
I have been able to make a workable ClickOnce solution in .Net8

This article
https://learn.microsoft.com/en-us/visualstudio/deployment/access-clickonce-deployment-properties-dotnet?view=vs-2022
and this class
https://github.com/dotnet/deployment-tools/blob/main/docs/dotnet-mage/ApplicationDeployment.cs
show how to access the new properties that were surfaced in .Net7

In terms of user settings not upgrading when a new ClickOnce version is published, it turns out the assembly needs to be signed
https://learn.microsoft.com/en-us/biztalk/core/how-to-configure-a-strong-name-assembly-key-file
This should be documented way better and more should be done to warn if the problem is present, ie user settings exist and the main assembly is not signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants