I have 3 environment specific appsettings
files in my .Net core application
in project.json
I have setup publishOptions
In my case I have several appSettings files for several live environments, e.g. appSettings.Env1Live.json, appSettings.Env2Live.json, etc.
I looked through the article https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-3.1 and added the following statements in the corresponding publish (pubxml) config files per each environment.
E.g. for PublishToEnvironment1.pubxml added:
So, in the published folder I have only two necessary files, other appSettings.*Live.json were not published.
appsettings.json
appsettings.Env1Live.json