Re: error when compiled in release mode works in debug mode.

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jigar (Jigar_at_discussions.microsoft.com)
Date: 06/26/04


Date: Sat, 26 Jun 2004 14:01:02 -0700

I do not think that code can help me.

I am already getting stack trace which we normally get while running web applications. i beleave when my webcontrol (dll) is compiled in release mode i can not get more information then what i am getting. so i need to compile same application with debug mode, and when i compile same application in debug mode error disappears.

Object reference not set to an instance of an object.
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.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
myapp.getDrawData() +1371
myapp..ctor(Data Data) +639
mycontrol.Render(HtmlTextWriter output) +223
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
....
..
.

"Sahil Malik" wrote:

> Jigar,
>
> Look at this article -
>
> http://www.ftponline.com/vsm/2003_11/magazine/features/dollard/
>
> It's got a downloadable code thing that will let you trap the exact stack
> trace etc. (if you are not doing that already), that will point you to the
> exact line the error is happening at. Maybe that'll help ya a bit !! :)
>
> - Sahil Malik
> Independent Consultant
> You can reach me thru my blog at -
> http://www.dotnetjunkies.com/weblog/sahilmalik/
>
>
>
> "Jigar" <Jigar@discussions.microsoft.com> wrote in message
> news:7D259077-4B9F-492A-9B08-35C848FE9C2F@microsoft.com...
> > Control throws error when compiled in release mode. but works nicely when
> compiled in debug mode.
> >
> > I have created class library which has several user controls, now one of
> the control is throwing null reference error.(object reference not set to
> instance of object).
> >
> > To trap exact place of error I recompiled this dll with debug option .
> to my surprise control works with out error when I compile with debug
> option.
> >
> > I tried switching .net frame work version 1.0 & 1.1 same thing happens
> with both.
> >
> > How I can trap error if I can not get error in debug mode? and what could
> be reason for this behavior
>
>
>



Relevant Pages

  • Re: Sessions timing out quickly despite very high timeout set in web.config
    ... Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. ... and location of the exception can be identified using the exception stack trace below. ... When reviewing the code from the trace, it always is something that references something in the Session, and my ...
    (microsoft.public.dotnet.framework.aspnet)
  • moving web application from win2000 to win2003...
    ... Please help me track down my problem (using stack trace I assume). ... Object reference not set to an instance of an object. ... current web request. ... Exception Details: System.NullReferenceException: Object reference not set ...
    (microsoft.public.sqlserver.odbc)
  • Re: Object reference not set
    ... that has two other server side tables on it that have been working ... Object reference not set to an instance of an object. ... Exception Details: System.NullReferenceException: Object reference ... be identified using the exception stack trace below. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Custom asp.net app error in Sharepoint 2007
    ... Object reference not set to an instance of an object. ... current web request. ... Please review the stack trace for more information about ... Exception Details: System.NullReferenceException: Object reference not set ...
    (microsoft.public.sharepoint.portalserver)
  • RE: Custom asp.net app error in Sharepoint 2007
    ... Object reference not set to an instance of an object. ... current web request. ... Please review the stack trace for more information about ... Exception Details: System.NullReferenceException: Object reference not set ...
    (microsoft.public.sharepoint.portalserver)