Azure ASP.NET Core 2.1应用程序不读取appsettings.json(与VSTS一起部署)

编程入门 行业动态 更新时间:2024-10-27 17:16:12
本文介绍了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核心应用是否读取了应用程序设置"? variabes,而不是appsettings.json?我测试过,这是真的,但不知道为什么.

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

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

2) How to configure asp 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:

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

感谢

更多推荐

Azure ASP.NET Core 2.1应用程序不读取appsettings.json(与VSTS一起部署)

本文发布于:2023-11-16 17:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606240.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   Core   NET   Azure   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!