Azure websites complaining Role environment . FAILED TO INITIALIZE on startup(Azure 网站抱怨角色环境.启动时无法初始化)
问题描述
我的问题类似于 Azure 网站抱怨角色环境 .初始化失败
我在 Azure 应用服务支持事件查看器中看到的错误:
Error that I see in the Azure App Service Support Event Viewer:
"9236w3wp角色环境.初始化失败.小时:-2147024891"
" 9236 w3wp Role environment . FAILED TO INITIALIZE. hr: -2147024891 "
每次网站启动时都会发生这种情况.除此之外 - 网站功能很好.除了随机(可能需要 10-30 分钟)它以应用程序已终止"停止.(我通过 azure 应用程序日志看到了这个错误).我不确定这两件事是否相关,但我正在尝试首先解决初始化失败"的问题.
It happens every single time on startup of the website. Other than that - website functions just fine. Except, randomly (it might take 10-30 minutes) it stops with "The application was terminated." (i see this error through azure application logs). I am not sure if these two things are related, but I am trying to first fix the "FAILED TO INITIALIZE" issue.
我的代码中的任何地方都没有对 RoleEnvironment 的引用(StackOverflow 上的一些用户提到这可能是一个问题).
I don't have references to RoleEnvironment anywhere in my code (some users on StackOverflow mentioned that this might be an issue).
我阅读了很多帖子,但似乎没有一个适合我的情况.
I read through many posts but none seem to work for my case.
推荐答案
所以,问题是对Microsoft.WindowsAzure.Configuration"的引用.一旦不再引用此程序集 - 启动时不再出现错误.显然,此程序集旨在用于云服务,而不是 Web 应用程序.
So, the issue was the reference to "Microsoft.WindowsAzure.Configuration". Once this assembly is not referenced anymore - no more errors on startup. Apparently, this assembly is designed to be used with Cloud Services, not Web Applications.
这篇关于Azure 网站抱怨角色环境.启动时无法初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Azure 网站抱怨角色环境.启动时无法初始化


- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04