Azure 网站抱怨角色环境.启动时无法初始化

Azure websites complaining Role environment . FAILED TO INITIALIZE on startup(Azure 网站抱怨角色环境.启动时无法初始化)
本文介绍了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 网站抱怨角色环境.启动时无法初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Can I initialize a BCL immutable collection using braces?(我可以使用大括号初始化BCL不可变集合吗?)
The type initializer for #39;System.Data.Entity.Internal.AppConfig#39; threw an exception on a Sub Website(“System.Data.Entity.Internal.AppConfig的类型初始化程序在子网站上引发异常)
Possible to initialize multiple variables from a tuple?(可以从一个元组初始化多个变量吗?)
error loading database initializer with EF6(使用 EF6 加载数据库初始化程序时出错)
How to force fire OnModelCreating every DataContext initialized up(如何强制触发 OnModelCreating 每个初始化的 DataContext)
The type appear in two structurally incompatible initializations within a single LINQ to Entities query(该类型出现在单个 LINQ to Entities 查询中的两个结构不兼容的初始化中)