首页 文章

未在托管服务或Development Fabric中运行 . 部署版本出错

提问于
浏览
1

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

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

来源错误:

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

堆栈跟踪:

[InvalidOperationException:未在托管服务或开发结构中运行 . ] Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance()518 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor()34

[ConfigurationErrorsException:无法创建Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,Version = 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,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 . ] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context,HttpApplication应用)581 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext,HttpContext context,MethodInfo [] handlers)179 System.Web.HttpApplication.InitSpecial(HttpApplicationState state,MethodInfo [] handlers,IntPtr appContext,HttpContext context)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,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 . ] System.Web.HttpRuntime.FirstRequestInit(HttpContext context)678 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context)810

有人可以帮忙吗?

1 回答

  • 0

    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>
    

相关问题