I have a console app in .Net 6 and wondering how can I have multiple appSettings files?
I want to have one for
appsettings.development.json appsettings.test.json appsettings.production.json
I will be deploying the console application onto windows servers and hooking it up to a scheduled task. Depending on which environment I want a different appsettings to be used. I am not sure how to do this.
I think I would have to create an environment variable on each server to make it use the right file but hoping there is more a coding way automatically use the right appsettings file.
I found this posting that seems to be almost what I need but it is for web apps and not console apps
Automatically set appsettings.json for dev and release environments in asp.net core?