未在托管服务或 Development Fabric 中运行

发布于 2024-11-05 07:36:28 字数 1633 浏览 1 评论 0原文

我有一个与 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 <踪迹> <听众> <添加类型=“Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,Microsoft.WindowsAzure.Diagnostics,版本= 1.0.0.0,文化=中性,PublicKeyToken = 31bf3856ad364e35” 名称=“AzureDiagnostics”> <过滤器类型=“”/>

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何必那么矫情 2024-11-12 07:36:28

要检查的一件事:确保您的云项目设置为启动项目。

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

天涯离梦残月幽梦 2024-11-12 07:36:28

大多数 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文