2013-11-21 79 views
2

「不是在託管服務或Development Fabric中運行的」我有下部署在Azure雲服務中運行的WebRole但今天出版後,我收到此錯誤:即使部署到Azure的

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的,所以我不明白怎麼就不能在運行託管服務。

+0

不知道這是關係到你的錯誤,但你可能要看看這篇文章:http://stackoverflow.com/questions/13879443/not-running-in-a-hosted-service-or-the-development-fabric-production-not-debug他們談到了同樣的錯誤與DotNetOpenAuth。 –

+0

你在哪裏看到這個錯誤出現在?事實上,它不能真正啓動跟蹤監視器,這讓我很好奇你在哪裏看到這個錯誤,這可能暗示發生了什麼。這個錯誤信息是如何被捕獲的? – MikeWo

回答

0

在Visual Studio中打開角色屬性,並檢查是否勾選了「啓用診斷」。同時,(只是爲了真正做到),檢查您是否已經在你的web.config添加爲dependentAssembly的Microsoft.WindowsAzure.Diagnostics:如果

<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>