Azure ASP.NET Core 2.1应用程序不读取appsettings.json(与VSTS一起部署) [英] Azure ASP.NET Core 2.1 app does not read appsettings.json (It is deployed with VSTS)

查看:74
本文介绍了Azure ASP.NET Core 2.1应用程序不读取appsettings.json(与VSTS一起部署)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从VSTS部署了一个ASP.NET Core 2.1应用程序,其中包含"Azure App Service Deploy".版本4.该应用程序正在运行,但在读取应用程序设置变量时具有运行时异常.原因是应用程序使用的这些变量存储在appsettings.json中.

I have deployed one ASP.NET Core 2.1 app from VSTS with "Azure App Service Deploy" version 4. The app is running but has runtime exception at reading application setting variable. The reasons is these variables used by app are stored in appsettings.json. 

我对这些设置变量感到困惑.

I am confusing for these settings variables. 

1)asp.net核心应用是否读取了应用程序设置"? variabes,而不是appsettings.json?我测试过,这是真的,但不知道为什么.

1) Does asp.net core app read "Application settings" variabes rather than appsettings.json? I tested, it is true but don't know why. 

2)如何以天蓝色将asp.net核心应用程序配置为读取appsettings.json,而不是从应用程序设置"中读取.

2) How to configure asp.net core app in azure to read appsettings.json rather than from "Application settings". 

谢谢. 

推荐答案

您能否检查appsettings.json是否已真正部署,因为本文建议通常将其忽略:

Can you check if the appsettings.json has actually been deployed, as this article suggests it is usually ignored:

https://blogs.msdn.microsoft.com/waws/2018/06/12/asp-net-core-settings-for-azure-app-service/

感谢


这篇关于Azure ASP.NET Core 2.1应用程序不读取appsettings.json(与VSTS一起部署)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆