本文介绍了InvalidOperationException:堆栈为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序工作正常,但突然停止工作,并给出此错误
[InvalidOperationException:Stack empty。]
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource资源)+52
系统。 Collections.Generic.Stack`1.Pop()+6694385
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer,Object renderedObject)+84
System.Web.UI .RenderTraceListenerList.EndRendering(TextWriter writer,Object renderedObject)+58
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,ControlAdapter适配器)+142
System.Web.UI.Control.RenderControl(HtmlTextWriter作者,ControlAdapter适配器)+100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)+25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)+1386

my application was worked fine but suddenly it is stop working and give this error[InvalidOperationException: Stack empty.] System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +52 System.Collections.Generic.Stack`1.Pop() +6694385 Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer, Object renderedObject) +84 System.Web.UI.RenderTraceListenerList.EndRendering(TextWriter writer, Object renderedObject) +58 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +142 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386

推荐答案

我有同样的问题,但现在固定下来。首先我禁用了PageInspector。

I had the same problem, but its fixed now. Firstly I disabled PageInspector.

之后,我遇到另一个与ResolveUrl方法相关的错误,删除方法并修复问题瞧!它的工作完美。最后,我通过删除以前的设置启用了PageInspector,仍然可以使用。

After that I got another error which was related to ResolveUrl method, I removed method and fixed the problem and voila! its working perfectly. Finally, I enabled PageInspector by removing previous settings and still it works.

这篇关于InvalidOperationException:堆栈为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 22:21