【问题标题】:Not running in a hosted service or the Development Fabric. Error in deployed version不在托管服务或 Development Fabric 中运行。部署版本出错
【发布时间】:2013-10-11 01:11:29
【问题描述】:

我在 Web 角色上部署的应用程序中启用了诊断跟踪侦听器。通过模拟器运行时,在开发环境中一切正常。但是在 azure 上部署时我收到以下错误 不在托管服务或 Development Fabric 中运行。 说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详细信息:System.InvalidOperationException:未在托管服务或 Development Fabric 中运行。

来源错误:

在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。

堆栈跟踪:

[InvalidOperationException:不在托管服务或 Development Fabric 中运行。] Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +518 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +34

[ConfigurationErrorsException:无法创建 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,版本=2.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35。] System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) +9004943 System.Diagnostics.TypedElement.BaseGetRuntimeObject() +110 System.Diagnostics.ListenerElement.GetRuntimeObject() +989 System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +252 System.Diagnostics.TraceInternal.get_Listeners() +331 System.Diagnostics.TraceInternal.WriteLine(字符串消息)+161 AVAWebApplication.Global.Application_Start(Object sender, EventArgs e) +28

[HttpException (0x80004005): 无法创建 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,版本=2.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35。] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext 上下文,HttpApplication 应用程序)+581 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext,HttpContext 上下文,MethodInfo[] 处理程序)+179 System.Web.HttpApplication.InitSpecial(HttpApplicationState 状态,MethodInfo[] 处理程序,IntPtr appContext,HttpContext 上下文)+322 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +384 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +397

[HttpException (0x80004005): 无法创建 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,版本=2.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35。] System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文)+678 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext 上下文)+159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +810

有人可以帮忙吗?

【问题讨论】:

    标签: azure azure-web-roles diagnostics


    【解决方案1】:

    DotNetOpenAuth.Logger 似乎与 WAD(windows azure 诊断)冲突。另见这篇文章:Not running in a hosted service or the Development Fabric (Production, not debug/local)

    从 web.config 中移除跟踪监听器:

    <trace> 
        <listeners> 
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> 
                <filter type="" /> 
            </add> 
        </listeners> 
    </trace>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-25
      • 2020-01-05
      • 2018-06-21
      • 2018-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-07-25
      相关资源
      最近更新 更多