2

I have a WebRole running under a cloud service deployed on Azure but after publishing today I am getting this error:

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)

Line 138 of Profile.svc.vb is simply:

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

This error seems to occur quite often when people are running locally in the emulator but this is deployed to Azure so I don't understand how it cannot be running in a hosted service.

Richard Dalton
  • 35,513
  • 6
  • 73
  • 91
  • Not sure if this is related to your error, but you may want to check out this post: http://stackoverflow.com/questions/13879443/not-running-in-a-hosted-service-or-the-development-fabric-production-not-debug where they talked about the same error with DotNetOpenAuth. – Gaurav Mantri Nov 21 '13 at 11:24
  • Where are you seeing this error appear at ? The fact that it can't actually start the trace monitor makes me curious where you are seeing this error at, which might hint at what's going on. How is this error message being captured currently? – MikeWo Dec 05 '13 at 19:33

1 Answers1

0

Open the role properties in Visual Studio and check if you ticked "Enable Diagnostics". Also (just to REALLY make sure), check if you have the Microsoft.WindowsAzure.Diagnostics added as a dependentAssembly in your web.config:

<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>
ahmed.eltawil
  • 561
  • 4
  • 16