未在托管服务或 Development Fabric 中运行
我有一个与 webRole 调试相关的问题。
不在托管服务或开发结构中运行。 描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.InvalidOperationException:未在托管服务或开发结构中运行。
源错误:
当前 Web 请求执行期间生成未处理的异常。有关异常来源和位置的信息可以使用下面的异常堆栈跟踪来识别。
堆栈跟踪:
[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
有关的 web.config 部分
这是与 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要检查的一件事:确保您的云项目设置为启动项目。
One thing to check: Make sure your cloud project is set as the startup project.
大多数 Azure 诊断都需要管理权限。您可能没有以管理员身份启动 Windows Azure 计算模拟器,这就是 API 调用失败的原因。
解决方案 – 以管理员身份启动 Windows Azure 计算模拟器,或让 Visual Studio 启动模拟器(前提是 Visual Studio 已经以管理权限运行)。
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).