学海无涯

导航

appsettings.json launchSettings.json 发布 配置

默认的 JsonConfigurationProvider 会按以下顺序加载配置:

  1. appsettings.json
  2. appsettings.{Environment}.json:例如,appsettings.Production.json 和 appsettings.Development.json 文件。 文件的环境版本是根据 IHostingEnvironment.EnvironmentName 加载的。 有关详细信息,请参阅在 ASP.NET Core 中使用多个环境

appsettings.{Environment}.json 值替代 appsettings.json 中的键。 例如,默认情况下:

  • 在开发环境中,appsettings.Development.json 配置会覆盖在 appsettings.json 中找到的值。
  • 在生产环境中,appsettings.Production.json 配置会覆盖在 appsettings.json 中找到的值。 例如,在将应用部署到 Azure 时。

commandName 的值可指定要启动的 Web 服务器。 commandName 可为以下任一项:

  • IISExpress:启动 IIS Express。
  • IIS:不启动任何 Web 服务器。 IIS 预计可用。
  • Project:启动 Kestrel。

posted on 2024-11-11 14:32  宁静致远.  阅读(40)  评论(0编辑  收藏  举报