9

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
Abel
  • 56,041
  • 24
  • 146
  • 247
Asmaa El Shabaka
  • 103
  • 1
  • 1
  • 3

2 Answers2

24

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

<appSettings>
       <add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/>
</appSettings>

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.

Dipen Shah
  • 25,562
  • 1
  • 32
  • 58
  • 1
    Thanks. This saved my poor head. It was being banged against a fairly solid wall for the last little while. Disabling this pointed to the root cause of the problem. – Ads Aug 05 '14 at 06:02
  • Thanks as well. I would never have figured this out otherwise. – David Apr 08 '15 at 06:14
  • 1
    How did you know to try disabling PageInspector? – Since_2008 Nov 25 '15 at 20:10
  • I found another solution trying to solve a very similar problem. It could be related: https://stackoverflow.com/questions/20406497/system-invalidoperationexception-stack-empty/45888866#45888866 – Rolo Aug 28 '17 at 21:10
  • @Kukoy, I don't remember how as its been a long ago, most probably by using trial and error or reading through msdn reference – Dipen Shah Aug 29 '17 at 13:39
0

For me, it was the Brower Link. Disabling it worked for me. For more reference check out https://learn.microsoft.com/en-us/aspnet/visual-studio/overview/2013/using-browser-link enter image description here

mrinali
  • 140
  • 10