dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
6.93k stars 1.15k forks source link

Settings for a WPF app goes into new folders for every publish of click-once #9195

Open wallymathieu opened 3 months ago

wallymathieu commented 3 months ago

Description

On each publish we get a new folder.

Reproduction Steps

Create a minimal WPF app in .net8, publish it as a clickonce to IIS and install from IIS.

Say that my App Data folder for the Company ${CompanyName} is: C:\Users\${UserName}\AppData\Local\${CompanyName} Then inside that folder we get new subfolders when saving user settings in the following format:

WpfApp1_Path_mhp42l3wrf1iq0iczitfpwjmqjuqowdp\data\${Version}
WpfApp1_Url_0hil1mzikc4mwep0qb23dmk11i23h1aj\data\${Version}
WpfApp1_Url_jmiaz0vxapsp3h0wc2fnpf4bopt0peau\data\${Version}

Expected behavior

The expected behaviour would be that the old settings are copied or read on startup.

Actual behavior

You do not get any of the old user settings.

Regression?

This is a regression. It works in .NET Framework. Perhaps it is related to how .net Framework clickonce applications store user data in a special folder.

Known Workarounds

Use https://github.com/Bluegrams/SettingsProviders

Configuration

.net 8 Windows

Other information

No response

wallymathieu commented 3 months ago

This looks related to dotnet/runtime#31959

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @dotnet/area-system-configuration See info in area-owners.md if you want to be subscribed.

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @agocke, @vitek-karas, @vsadov See info in area-owners.md if you want to be subscribed.

miloush commented 1 month ago

Not quite convinced this is WPF business yet as settings are not part of the WPF codebase.

@wallymathieu are you calling Update()?

wallymathieu commented 1 month ago

In ClickOnce for .net framework you don’t need to call update

wallymathieu commented 1 month ago

Calling update does not work unfortunately. We tried that since we figured we did something wrong in our old WPF .net framework app, but in a .net WPF app, the update does not help us…