I am new in .NET Core and as far as I see from my search on the web, appsettings.Development.json is used for development config while developing the app and appsettings.Production.json is used on the published app in production server. Here are the example part that I set on both:
appsettings.Development.json:
"ConnectionStrings": {
"DefaultConnection": "Server=localhost,21433;Initial Catalog=DemoDbDev;User Id=demouser;Password=******;"
},
appsettings.Production.json:
"ConnectionStrings": {
"DefaultConnection": "Server=demo-prod-db,1433;Initial Catalog=DemoDbProd;User Id=demouser;Password=******;"
},
Here are some question that I need to be clarified:
1) What is the purpose of the appsettings.json? Is it used for default config or for the other settings that are not in the appsettings.Development.json or appsettings.Production.json?
2) Is the environment set on the launchSettings.json in the Properties folder? If so, should we manually update this file before publishing the app to the production server?
3) Is there anything that I should keep in mind regarding to Development and Production environment configs while developing and publishing my app (to IIS Server or Docker container)?
Any help would be really appreciated.