Hi guys,
I'm not sure if this issue is arising because of some kind of misconfiguration at my end or because of a bug in v4.1. Essentially, whenever I insert two (or more) Razor functions that retrieve data into a page, it throws errors at seemingly random points during the rendering of those functions. Sometimes the page does not render at all, throwing the error:
I'm not sure if this issue is arising because of some kind of misconfiguration at my end or because of a bug in v4.1. Essentially, whenever I insert two (or more) Razor functions that retrieve data into a page, it throws errors at seemingly random points during the rendering of those functions. Sometimes the page does not render at all, throwing the error:
[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.BrowserLinkExecutionListener.GetOutputPositionTracker(TextWriter textWriter) +93
Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.BrowserLinkExecutionListener.BeginContext(PageExecutionContext context) +19
CallSite.Target(Closure , CallSite , Object , Object ) +131
System.Web.WebPages.Instrumentation.PageExecutionListenerAdapter.BeginContext(PageExecutionContextAdapter context) +191
System.Web.WebPages.Instrumentation.<>c__DisplayClass1.<BeginContext>b__0(PageExecutionListenerAdapter listener) +52
System.Web.WebPages.Instrumentation.InstrumentationService.RunOnListeners(HttpContextBase context, Action`1 act) +99
System.Web.WebPages.Instrumentation.InstrumentationService.BeginContext(HttpContextBase context, String virtualPath, TextWriter writer, Int32 startPosition, Int32 length, Boolean isLiteral) +107
System.Web.WebPages.WebPageExecutingBase.BeginContext(String virtualPath, Int32 startPosition, Int32 length, Boolean isLiteral) +148
ASP._Page_App_Data_PageTemplates_MetronicBackendDefaultPage_HeaderImageLayout_cshtml.Execute() in c:\Users\Andrew\AppData\Local\Temp\Temporary ASP.NET Files\root\e1cff13a\13125fa1\App_Web_rhqn1c2p.2.cs:0
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +68
System.Web.WebPages.WebPage.ExecutePageHierarchy() +151
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
Composite.Plugins.PageTemplates.Razor.RazorPageRenderer.RendererPage(Object sender, EventArgs e) +780
System.Web.UI.Control.OnInit(EventArgs e) +92
System.Web.UI.Page.OnInit(EventArgs e) +12
Renderers_Page.OnInit(EventArgs e) in c:\Users\Andrew\Dropbox\Programming\ellipsoid.org\EmeraldDream\Website\Renderers\Page.aspx.cs:47
System.Web.UI.Control.InitRecursive(Control namingContainer) +134
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +489
Other times, the page will render but one or both of the functions will fail to render at seemingly random points during the function, displaying the error:Error: Object reference not set to an instance of an object.
To replicate the error I did the following:- Create a new Razor function
-
Add some code using the data access layer, e.g.:
@{
var someData = Data.Get<IPage>();
}
- Insert the function multiple times into a page
-
View the page and hit refresh a few times to get the varying behaviour