EDN Admin
Well-known member
I have a problem when running a web application. The error is as shown below:<br/>
<br/>
> Server Error in / Application.<br/>
<br/>
> Object reference not set to an instance of an object. <br/>
> Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
<br/>
<br/>
> Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.<br/>
<br/>
> Source Error: <br/>
<br/>
> The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:<br/>
<br/>
> 1. Add a "Debug=true" directive at the top of the file that generated the error. Example:<br/>
<br/>
> <%@ Page Language="C#" Debug="true" %><br/>
<br/>
> or:<br/>
<br/>
> 2. Add the following section to the configuration file of your application:<br/>
<br/>
> <configuration><br/>
> <system.web><br/>
> <compilation debug="true"/><br/>
> </system.web><br/>
> </configuration><br/>
<br/>
> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.<br/>
<br/>
> Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. <br/>
<br/>
> Stack Trace: <br/>
<br/>
<br/>
> [NullReferenceException: Object reference not set to an instance of an object.]<br/>
ASP.me_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) +78<br/>
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +114<br/>
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +239<br/>
System.Web.UI.Page.Render(HtmlTextWriter writer) +37<br/>
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239<br/>
<br/>
<br/>
The problem is that this error only occurs sometimes and would be ok once we refresh the page. This problem is bugging me because it never happen when I debug the code. Only in the production server it happens. The only resolve is to refresh the page. But that
is not an acceptable solution.
View the full article
<br/>
> Server Error in / Application.<br/>
<br/>
> Object reference not set to an instance of an object. <br/>
> Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
<br/>
<br/>
> Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.<br/>
<br/>
> Source Error: <br/>
<br/>
> The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:<br/>
<br/>
> 1. Add a "Debug=true" directive at the top of the file that generated the error. Example:<br/>
<br/>
> <%@ Page Language="C#" Debug="true" %><br/>
<br/>
> or:<br/>
<br/>
> 2. Add the following section to the configuration file of your application:<br/>
<br/>
> <configuration><br/>
> <system.web><br/>
> <compilation debug="true"/><br/>
> </system.web><br/>
> </configuration><br/>
<br/>
> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.<br/>
<br/>
> Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. <br/>
<br/>
> Stack Trace: <br/>
<br/>
<br/>
> [NullReferenceException: Object reference not set to an instance of an object.]<br/>
ASP.me_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) +78<br/>
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +114<br/>
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +239<br/>
System.Web.UI.Page.Render(HtmlTextWriter writer) +37<br/>
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239<br/>
<br/>
<br/>
The problem is that this error only occurs sometimes and would be ok once we refresh the page. This problem is bugging me because it never happen when I debug the code. Only in the production server it happens. The only resolve is to refresh the page. But that
is not an acceptable solution.
View the full article