Appsettings.json Different Versions?

前端 未结 1 1049
南笙
南笙 2021-02-04 19:26

I am starting asp.net core 2.1 coming from .NET and wondering how do I make multiple AppSetting.json files?

Before we had the webconfig that you could have webconfig.deb

相关标签:
1条回答
  • By default ASP.NET Core will attempt to load an additional appsettings.<EnvironmentName>.json file. Using the default environment names available, this allows you to create the following files:

    • appsettings.json - loaded regardless of the environment name
    • appsettings.Development.json - loaded only when the environment name is Development
    • appsettings.Staging.json - loaded only when the environment name is Staging
    • appsettings.Production.json - loaded only when the environment name is Production

    The name of the environment is usually controlled via the ASPNETCORE_ENVIRONMENT environment variable or via launchSettings.json when developing (checkout the docs).

    Take a look at the documentation for configuration for more info regarding this topic.

    0 讨论(0)
提交回复
热议问题