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.