【问题标题】:'Not running in a hosted service or the Development Fabric' Even though deployed to Azure“不在托管服务或开发结构中运行”即使部署到 Azure
【发布时间】:2013-11-21 11:00:21
【问题描述】:

我有一个在 Azure 上部署的云服务下运行的 WebRole,但今天发布后我收到此错误:

The server encountered an error processing the request. 
The exception message is 'Not running in a hosted service or the Development Fabric.'. 
See server logs for more details. The exception stack trace is: 

at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() at 
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() at 
Profile.LoginAuthenticate(Stream Params) in 
Profile.svc.vb:line 138 at 
SyncInvokeLoginAuthenticate(Object , Object[] , Object[] ) at 
System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at 
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)     at 
System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

Profile.svc.vb 的第 138 行很简单:

Dim trace As New Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener()

当人们在模拟器中本地运行时,这个错误似乎经常发生,但它已部署到 Azure,所以我不明白它为什么不能在托管服务中运行。

【问题讨论】:

  • 不确定这是否与您的错误有关,但您可能想查看这篇文章:stackoverflow.com/questions/13879443/… 他们谈到了与 DotNetOpenAuth 相同的错误。
  • 您在哪里看到此错误出现在?它实际上无法启动跟踪监视器的事实让我很好奇您在哪里看到此错误,这可能暗示发生了什么。当前如何捕获此错误消息?

标签: vb.net azure azure-web-roles


【解决方案1】:

在 Visual Studio 中打开角色属性并检查是否勾选了“启用诊断”。另外(只是为了确保),检查您是否在 web.config 中将 Microsoft.WindowsAzure.Diagnostics 添加为dependentAssembly:

<dependentAssembly>
    <assemblyIdentity name="Microsoft.WindowsAzure.Diagnostics" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.8.0.0" newVersion="1.8.0.0" />
</dependentAssembly>

【讨论】:

    猜你喜欢
    • 2011-04-08
    • 1970-01-01
    • 1970-01-01
    • 2013-10-11
    • 2016-07-25
    • 2019-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多