Azure 网站抱怨角色环境.启动时无法初始化 [英] Azure websites complaining Role environment . FAILED TO INITIALIZE on startup

查看:24
本文介绍了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 网站抱怨角色环境.启动时无法初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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