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

时间:2013-10-04 06:06:36

标签: azure azure-web-roles diagnostics

我在部署在Web角色上的应用程序中启用了诊断跟踪侦听器。通过模拟器运行时,在开发环境中一切正常。但是我在azure上部署时收到以下错误 未在托管服务或Development Fabric中运行。 描述:执行当前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(String message)+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 app)+581    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext,HttpContext context,MethodInfo [] handlers)+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,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 :(得分: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>