天蓝色 – 不在托管服务或开发结构中运行(生产,而不是调试/本地)
发布时间:2020-12-15 18:34:50 所属栏目:asp.Net 来源:网络整理
导读:我刚刚开始使用Windows Azure,并使用Azure模拟器在本地运行的一个小型MVC应用程序。我注册了免费试用版,下载了我的发布资料并将其导入VS2012。发布到Azure并得到一些程序集参考错误。我通过设置它们来复制local = true来解决这个问题,现在我得到: Not ru
我刚刚开始使用Windows Azure,并使用Azure模拟器在本地运行的一个小型MVC应用程序。我注册了免费试用版,下载了我的发布资料并将其导入VS2012。发布到Azure并得到一些程序集参考错误。我通过设置它们来复制local = true来解决这个问题,现在我得到:
Not running in a hosted service or the Development Fabric. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Not running in a hosted service or the Development Fabric. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Not running in a hosted service or the Development Fabric.] Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +447 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +40 [ConfigurationErrorsException: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,Version=1.8.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35.] System.Diagnostics.TraceUtils.GetRuntimeObject(String className,Type baseType,String initializeData) +6792949 System.Diagnostics.TypedElement.BaseGetRuntimeObject() +45 System.Diagnostics.ListenerElement.GetRuntimeObject() +83 System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +143 System.Diagnostics.TraceInternal.get_Listeners() +181 System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType,Int32 id,String format,Object[] args) +155 DotNetOpenAuth.Loggers.TraceLogger.Info(Object message) +26 DotNetOpenAuth.Logger.CreateWithBanner(String name) +45 DotNetOpenAuth.Logger..cctor() +14 [TypeInitializationException: The type initializer for 'DotNetOpenAuth.Logger' threw an exception.] DotNetOpenAuth.Logger.get_Library() +14 DotNetOpenAuth.Reporting.Initialize() +410 DotNetOpenAuth.Reporting.set_Enabled(Boolean value) +31 DotNetOpenAuth.Reporting..cctor() +285 [TypeInitializationException: The type initializer for 'DotNetOpenAuth.Reporting' threw an exception.] Microsoft.Web.WebPages.OAuth.PreApplicationStartCode.Start() +41 [InvalidOperationException: The pre-application start initialization method Start on type Microsoft.Web.WebPages.OAuth.PreApplicationStartCode threw an exception with the following error message: The type initializer for 'DotNetOpenAuth.Reporting' threw an exception..] System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods,Func`1 setHostingEnvironmentCultures) +550 System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +90 System.Web.Compilation.BuildManager.ExecutePreAppStart() +135 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException) +516 [HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.Web.WebPages.OAuth.PreApplicationStartCode threw an exception with the following error message: The type initializer for 'DotNetOpenAuth.Reporting' threw an exception..] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context) +254 -------------------------------------------------------------------------------- 如果您在本地进行测试并将Web项目设置为启动项目而不是云项目,则会看到此错误,但正如我所说,这对于仿真器在本地运行良好,但是部署到Azure会导致此失败。 任何想法我在这里失踪? 谢谢 解决方法
将Windows Azure角色项目设置为“启动”项目。这解决了我的问题。当我在与启动项目相同的解决方案中设置另一个webapp时,遇到同样的问题。
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – MVC3将@model传递给局部视图
- asp.net-mvc – 使用SimpleMembership获取用户信息
- asp.net-mvc – 存储库层中的服务层重复功能
- asp.net-core – 当我们执行“kpm restore”时存储依赖项的
- asp.net-mvc-3 – R#6 – 在剃刀视图中建议“使用目录”.如
- asp.net-core – .net核心和SAML 2.0
- asp.net-core – VS2017 RC Web部署 – ERROR_CERTIFICATE_
- asp.net-mvc-4 – 具有动态部分视图创建的MVC Ajax
- asp.net-mvc – ASP.NET MVC文件名下划线
- asp.net-mvc-3 – 如何将int数组传递给RouteValueDictionar
推荐文章
站长推荐
- ASP.NET MVC 使用过滤器捕获异常 写入日志
- asp.net – 如何使用AspNetSqlMembershipProvide
- asp.net-mvc – ELMAH – 使用自定义错误页面收集
- asp.net-mvc-4 – 工作单元和通用存储库与实体框
- asp.net-mvc-4 – MVC4 MEF插件和控制器命名空间
- asp.net – CA1305:int.Parse(String)
- asp.net-mvc-3 – 是否可以在Javascript文件中使
- 使用经典ASP编写完整的XML文件
- asp.net-mvc – 如何在SelectList文本描述中组合
- ASP.NET Web.config转换将无法在安装程序中使用
热点阅读