Not running in a hosted service or the Development Fabric
Asked Answered
A

2

8

I have a problem related to the webRole debugging.

Not running in a hosted service or the Development Fabric. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Not running in a hosted service or the Development Fabric.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Not running in a hosted service or the Development Fabric.]
   Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +169
   Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +57

[ConfigurationErrorsException: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
   System.Web.Security.Roles.Initialize() +2230194
   System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs) +68
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

This is the web.config part concerning Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener

<system.diagnostics> <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> </system.diagnostics>

Aedile answered 6/5, 2011 at 10:10 Comment(0)
E
14

One thing to check: Make sure your cloud project is set as the startup project.

Extortion answered 6/5, 2011 at 12:47 Comment(2)
My Cloud Project is set as a start up project. I am just trying to debug and start a new instance of the webrole, it is not using azure compute emulator but ASP.net development server i check the web.config but seems ok.Aedile
A calling of System.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener method perhaps will cause the ASP.NET runtime to load and use that listener which needs a hosted service or the Development Fabric but still not sureAedile
C
5

Most of the Azure diagnostics require administrative rights. You may not have started the Windows Azure Compute Emulator as an Administrator and that is the reason why the API calls failed.

The solution – start the Windows Azure Compute Emulator as an Administrator, or let Visual Studio start the emulator (provided Visual Studio is already running with administrative rights).

Conflux answered 21/10, 2011 at 17:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.