❔ Any good persistent data solution for .net core 6 c#?
Back in .NET framework I use settings and the
Properties.Settings.Default
namespace to store data in just about a line of code but looks like I cannot use it with the new .net core 6, is there like a library or just a good way of storing persistent user data in .net core? something that doesnt require me to use a database8 Replies
A custom settings class comes to mind
Serialize it to json when the app closes (or any time you feel like) and save the file to some directory (
%(LOCAL)APPDATA%/MyApp
), and deserialize it when your app startsalright, sigh i guess i have to write it my own
Pretty sure the way you describe is only a WinForms thing?
System.Configuration.ConfigurationManager looks like a .net framework thing, and wont work on .net core
but my app runs in avalonia and is targeted to ubuntu desktop
Yeah if it's a Windows-only thing it won't work for you
there's https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration for config/user settings, but it's readonly
Configuration - .NET
Learn how to use the Configuration API to configure .NET applications.
theres a winrt api for packaged apps
otherwise youd have to write your own afaik
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.