c# - Azure WebApp 未启动 : An error occurred while starting the application. 加载配置文件失败

标签 c# azure asp.net-core asp.net-core-mvc

我有一个从 IIS Express 正常运行的 asp.net core 1.1.1 Web 应用程序。将其部署到 Azure 后,Web 应用无法启动。我收到以下错误:

启动应用程序时发生错误。 .NET 框架 X86 v4.0.30319.42000 | Microsoft.AspNetCore.Hosting 版本 1.1.1 |微软 window 6.2.9200

我已经从 Startup.cs 中删除了几乎所有内容,并打开了我所知道的所有调试可能性。我能得到的唯一错误是在 eventlog.xml 中:

Warning: Could not create stdoutLogFile \\?\D:\home\site\wwwroot\logs\stdout_6624_201732620236.log, ErrorCode = -2147024893.

.NET Runtime version 4.0.30319.0 - Loading profiler failed.  Failed trying to receive from out of process a request to attach a profiler.  HRESULT: 0x8007006d.

我认为这是一些权限问题,但我不知道在哪里以及如何在 Azure 文件系统上设置权限。

请帮帮我,我正在拔头发。我在这里坐了几个小时来解决这个问题。

谢谢。

最佳答案

我设法自己解决了这个问题,我希望这个解决方案可以帮助别人。

问题出在外部身份验证提供程序的配置上。正如建议的那样,我使用 Secret Manager Tool 设置应用程序 secret ,但是在部署到 Azure 后我没有设置变量。

我认为 Azure Web 应用程序设置中的身份验证/授权部分在某种程度上具有误导性。我在那里正确地设置了 secret 。我后来才意识到,设置应该在应用程序设置部分作为常规应用程序设置键值对。

关于c# - Azure WebApp 未启动 : An error occurred while starting the application. 加载配置文件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43034440/

相关文章:

c# - 将 linq 转换为模型类失败 "Unable to cast object of type ' System.Data.Entity.Infrastruct.DbQuery`1"

c# - DateTime 在当前上下文中不存在

c# - PropertyGrid 中的多行字符串

php - {R :1} and {C:1} on iis web. 配置文件之间的差异

c# - Windows Azure 中的.Net 4.0 线程池

c# - 如何尝试将对象转换为 double,如果失败则将其作为字符串?

azure - Autorest 无法生成任何内容,并且没有错误

ASP.NET core 2 充当反向代理用户重写中间件

c# - 什么时候应该使用 HttpContext.User.Identity.IsAuthenticated 和 SignInManager.IsSignedIn(HttpContext.User)?

c# - .Net Core 2.2/Kestrel/Swagger 禁用分块/编码