问题
I created new Project, new Website, in Sitefinity Project Manager, opened it in Visual Studio, started debugging. As no pages were created before it offers to log in to the backend. But when I'm clicking login instead of login form it gave me InvalidOperationException: Stack empty
exception
[InvalidOperationException: Stack empty.]
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +52
System.Collections.Generic.Stack`1.Pop() +6667365
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer, Object renderedObject) +152
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
If before I was able successfully login to the backend when ran project from Sitefinity Project Manager, after I opened the project in the Visual Studio it give me the error again and again even I'm trying to run it from the Project Manager. The only way to log in to the backend is to close the project in Visual Studio.
回答1:
It seems the error is the same like described here: InvalidOperationException: Stack empty
And two options to fix it. Set in Web.config either
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
</appSettings>
or
<appSettings>
<add key="vs:EnableBrowserLink" value="false"/>
</appSettings>
both worked for me.
Similar issue with the same solutions also was described here http://www.sitefinity.com/developer-network/knowledge-base/details/create-product-value-cannot-be-null-exception-when-the-project-is-included-into-an-empty-solution-in-visual-studio-2013 but error there was "Value cannot be null".
来源:https://stackoverflow.com/questions/34954077/invalidoperationexception-stack-empty-when-open-sitefinity-project-in-visual