What is purpose of either of that files?
When to use appsettings.json?
When to use runtimeconfig.json?
CodePudding user response:
appsettings.json
is for configuring your application. You (or your IDE) create this file. You manually maintain it with changes that you need.
runtimeconfig.json
is an internal configuration for the .NET runtime, used when it needs to run your application. Generally, you don't touch, edit, maintain or even version control this file. It's created automatically when your application is built.
It's never an either/or situation: you generally use both. appsettings.json
is used explicitly/manually, while runtimeconfig.json
is generally used under the hood and very rarely used manually.
CodePudding user response:
The appsettings. json file is an application configuration file used to store configuration settings such as database connections strings etc. This is basically a configuration file for configuring your application. You can able to edit it manually, whenever the changes are required.
The runtimeconfig. json file is generated automatically in the output directory when the application is built . It is basically a internal configuration for the .Net Runtime. There is no need of making any changes or any edit in this file manually as it is automatically generated at your application's Runtime.