Publish appsettings.json to another environment

I have three files appsettings.json, which is the file that I want to save "general general settings", then I have appsettings.Development.jsonand appsettings.Production.json.

When I make a publication from Visual Studio, it seems that it only copies appsettings.jsonand does not add / merge or even just send a simple copy of the deployment folder, for me this task should be included in the deployment pipeline.

Question: How can I do this? What am I missing? Is it not intended that these actions be included in the process?

+4
source share
1 answer

, project.json , / :

"buildOptions": {
  "copyToOutput": [
    ...
    "appsettings.json",
    "appsettings.*.json",
    ...
  ],
}

"publishOptions": {
  "include": [
    ...
    "appsettings.json",
    "appsettings.*.json",
    ...
  ]
}

. .

+4

Source: https://habr.com/ru/post/1649841/


All Articles