In the .NET Framework prior to .NET Core application settings were in app.config file. All settings e.g. database connection, email setting etc in one file along with each setting are strings which need to be converted to proper types (see the following for conversions) plus some functionality is missing like smtp sections. Moving to .NET Core, the standard is using a Json file generally named appsettings.json. The intent here is to layout how to use appsettings.json for desktop applications.

Developers building conventional .NET desktop solutions typically store information needed while running an application using My.Settings, which provides read/write capabilities. Here, learn how to use a Json file to store read-only information while discarding write back to the Json file. If there is a need to modify the Json file consider using Microsoft’s System.Text.Json Jump or Newton.Json Jump libraries to save modifications.

Microsoft TechNet article for novice developer

Seasoned developer, check out the source code done in VS2019 in the following project on GitHub.

The code can be opened in VS2019 via the Git menu, Clone a repository for or use Git Desktop or Git command line.