Doesn't work in hosting service or Fabric development

I have a problem with debugging webRole.

It does not work in a hosting service or in development. Description: An unhandled exception occurred during the execution of the current web request. View the stack trace for more information about the error and its occurrence in the code.

Exception Details: System.InvalidOperationException: Not executing in a hosted service or in development.

Source Error:

An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of the exception can be identified using the trace of the exception stack 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 part of web.config regarding 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>

+8
visual-studio-2010 azure azure-appfabric
source share
2 answers

One thing to check: make sure your cloud project is set as the launch project.

+14
source share

Most Azure conversations require administrative rights. You may not have started the Windows Azure Compute Emulator as an administrator, and for this reason, the API calls failed.

Decision. Run the Windows Azure Compute Emulator as an administrator, or let Visual Studio run the emulator (if Visual Studio already has administrator privileges).

+5
source share

All Articles