Azure网站抱怨角色环境.启动失败 [英] Azure websites complaining Role environment . FAILED TO INITIALIZE on startup
问题描述
我的问题类似于 Azure网站抱怨角色环境 .未能初始化
我在Azure App Service支持事件查看器中看到的错误:
Error that I see in the Azure App Service Support Event Viewer:
" 9236 w3wp 角色环境.未能初始化. hr:-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"的引用.一旦不再引用该程序集-启动时将不再出现错误.显然,此程序集旨在用于Cloud Services,而不是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网站抱怨角色环境.启动失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!