Once running ASP.NET 4.x application built in Visual Studio 2013 I am getting the below exception.
I have tried to disable the PageInspector by removing page inspector assembly
<assemblies>
<remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
and adding this configuration to app settings
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/>
</appSettings>
Nothing helped.
[/Pages/TargetPage.aspx] System.Web.HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Stack empty.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.Stack`1.Pop()
at Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer, Object renderedObject)
at System.Web.UI.RenderTraceListener.RenderTraceListenerList.EndRendering(TextWriter writer, Object renderedObject)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.LegacyPageAsyncInfo.<CallHandlersPossiblyUnderLock>b__32(Object o)
at System.Web.HttpContext.InvokeCancellableCallback(WaitCallback callback, Object state)
at System.Web.UI.Page.LegacyPageAsyncInfo.CallHandlersPossiblyUnderLock(Boolean onPageThread)
at System.Web.UI.Page.LegacyPageAsyncInfo.CallHandlers(Boolean onPageThread)
at System.Web.HttpAsyncResult.End()
at System.Web.UI.Page.LegacyAsyncPageEndProcessRequest(IAsyncResult result)
at System.Web.UI.Page.AsyncPageEndProcessRequest(IAsyncResult result)
Is there any way how to avoid the exception? Thanks a lot for any suggestions
We started VisualStudio 2015 (vs2015) from VisualStudio 2012 solution file and while building all the projects didnot build. This was due to the Enable Browser Link option enabled by default. I disabled the Enable Browser Link option and Re-built the solution which built all the projects successfully. After this I fired up the url in a browser and Boom it worked! For those who have similar scenario like mine. give it a whirl !
I have found the problem. There was changed way how to generate IDs of controls in GridView from default to
Which resulted in the exception. Not sure why the real exception was hidden by PageInspector stack empty. Just reverting the change to original resolved the issue.
Now the exception is different (but once GridView settings is back to original this disapper too)
I've also seen this problem in some web apps running on dev machines using Visual Studio 2013 with "Browser Link" enabled.
In multiple cases that I have seen, leaving Browser Link enabled causes all sorts of issues, both client script and security warnings, and server exceptions like this one (annoying thing is that it appears to be enabled by default, thanks Msft!)
I had the same exception, but in my case the problem was the following was missing:
Hope this help somebody.
I was getting this error when my
asp:panel
has a default button say XYZ and I modified the name XYZ and forgot to change default button name in panel.