|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DotNet error message : on which statement ?Hello.
An ASP.NET application reports the following error : .... [NullReferenceException: Object reference not set to an instance of an object.] RefFlu050.Page_Load(Object sender, EventArgs e) +1174 .... How can I identify which statement in my source code corresponds to RefFlu050.Page_Load +1174 ? Thanks in advance, Gilbert Hello,
How long is Page_load ? Some prefer to enable PDB files to get line numbers. My personal experience is that if the app is well structured to it is actually fairly easy to find out where it fails. Here you are trying to use an object that is still Nothing (for example FindControl would be a posisble cullprit). -- Show quoteHide quotePatrice "Gilbert Tordeur" <gilbert.tord***@orange.fr> a écrit dans le message de news:u8o9XCi2KHA.5212@TK2MSFTNGP04.phx.gbl... > Hello. > > An ASP.NET application reports the following error : > > ... > [NullReferenceException: Object reference not set to an instance of an > object.] > RefFlu050.Page_Load(Object sender, EventArgs e) +1174 > ... > > How can I identify which statement in my source code corresponds to > RefFlu050.Page_Load +1174 ? > > Thanks in advance, > Gilbert > Hi Patrice.
I have been discouraged to enable PDB in production. I understand the nature of the error (use of an object that has not yet been assigned). My question is : can I use the information "+1174" somehow to identify which statement it is related to ? This is a very rare error that we do not understand and that we are not able to redo on demand. Gilbert "Patrice" <http://scribe-en.blogspot.com/> a écrit dans le message de news: uK6ZjNi2KHA.5***@TK2MSFTNGP04.phx.gbl...Show quoteHide quote > Hello, > > How long is Page_load ? Some prefer to enable PDB files to get line > numbers. My personal experience is that if the app is well structured to > it is actually fairly easy to find out where it fails. Here you are trying > to use an object that is still Nothing (for example FindControl would be a > posisble cullprit). > > -- > Patrice > > "Gilbert Tordeur" <gilbert.tord***@orange.fr> a écrit dans le message de > news:u8o9XCi2KHA.5212@TK2MSFTNGP04.phx.gbl... >> Hello. >> >> An ASP.NET application reports the following error : >> >> ... >> [NullReferenceException: Object reference not set to an instance of an >> object.] >> RefFlu050.Page_Load(Object sender, EventArgs e) +1174 >> ... >> >> How can I identify which statement in my source code corresponds to >> RefFlu050.Page_Load +1174 ? >> >> Thanks in advance, >> Gilbert >> > Gilbert Tordeur wrote:
> Hi Patrice. Well, you need a try/catch in the area where you might think the problem > > I have been discouraged to enable PDB in production. I understand the nature > of the error (use of an object that has not yet been assigned). > > My question is : can I use the information "+1174" somehow to identify which > statement it is related to ? This is a very rare error that we do not > understand and that we are not able to redo on demand. > is at and the try/catch should encompass any sub code that might be called. catch ex ex.ToString() It will give the module name and line number that aborted, along with the full stack trace with inner exception message if it exist. Are your PDBs still current ? If yes it should be the line number in your
source code but this is not always exact (If I remember JIT optimized code could slightly offset the actual location resulting in a different line retrieved from the PDB). What do you have around 1174 ? If your Page_Load routine is huge you may want to add a trace (possibly using HttpContext.Current.Items). That way (and assuming you have a custom error handling routine that dumps this), you'll be able to retrieve at least the area where it happens... Later you may want to always structure your code in small chunks easier to manage... -- Show quoteHide quotePatrice "Gilbert Tordeur" <gilbert.tord***@orange.fr> a écrit dans le message de news:usL%23rsj2KHA.6048@TK2MSFTNGP06.phx.gbl... > Hi Patrice. > > I have been discouraged to enable PDB in production. I understand the > nature of the error (use of an object that has not yet been assigned). > > My question is : can I use the information "+1174" somehow to identify > which statement it is related to ? This is a very rare error that we do > not understand and that we are not able to redo on demand. > > Gilbert > > "Patrice" <http://scribe-en.blogspot.com/> a écrit dans le message de > news: uK6ZjNi2KHA.5***@TK2MSFTNGP04.phx.gbl... >> Hello, >> >> How long is Page_load ? Some prefer to enable PDB files to get line >> numbers. My personal experience is that if the app is well structured to >> it is actually fairly easy to find out where it fails. Here you are >> trying to use an object that is still Nothing (for example FindControl >> would be a posisble cullprit). >> >> -- >> Patrice >> >> "Gilbert Tordeur" <gilbert.tord***@orange.fr> a écrit dans le message de >> news:u8o9XCi2KHA.5212@TK2MSFTNGP04.phx.gbl... >>> Hello. >>> >>> An ASP.NET application reports the following error : >>> >>> ... >>> [NullReferenceException: Object reference not set to an instance of an >>> object.] >>> RefFlu050.Page_Load(Object sender, EventArgs e) +1174 >>> ... >>> >>> How can I identify which statement in my source code corresponds to >>> RefFlu050.Page_Load +1174 ? >>> >>> Thanks in advance, >>> Gilbert >>> >> > > Gilbert Tordeur wrote:
Show quoteHide quote > Hello. You put a debug brake point on the first line in Page_Load, and you > > An ASP.NET application reports the following error : > > ... > [NullReferenceException: Object reference not set to an instance of an > object.] > RefFlu050.Page_Load(Object sender, EventArgs e) +1174 > ... > > How can I identify which statement in my source code corresponds to > RefFlu050.Page_Load +1174 ? > > Thanks in advance, > Gilbert > > start single stepping until it blows. Then you'll have a line number where it blew and the line. The other thing you do is turn on 'line numbering' in VS for code text and the HTML text for the editor, as it could be blowing in the HTML too, which will show you the line numbers. On 12/04/2010 10:14, Gilbert Tordeur wrote:
> An ASP.NET application reports the following error : "+1174" denotes an offset into I.L. Code and not a line number.> > ... > [NullReferenceException: Object reference not set to an instance of an > object.] > RefFlu050.Page_Load(Object sender, EventArgs e) +1174 > How can I identify which statement in my source code corresponds to > RefFlu050.Page_Load +1174 ? You know which routine the exception occurred in (RefFlu050.Page_Load), so you can use ildasm to "pull apart" that particular method. The offsets appear down the lefthand side, prefixed with "IL_": IL_001b: ldloc.1 IL_001c: ldarg.1 IL_001d: ldarg.2 IL_001e: ldarg.3 IL_001f: callvirt instance class [System.Data]System.Data.DataSet [A.B.C.Processor]A.B.C.ID::E(string, class [A.B.MiddleTier]A.B.C/ClientData, class [A.B.Errors]A.B.IC&) IL_0024: stind.ref IL_0025: ldarg.3 IL_0026: ldind.ref The "callvirt" entries are probably the most important ones, being calls to others methods, hopefully ones that you wrote. HTH, Phill W. Hi Phill.
(back from holiday) ildasm, this is the tool I was missing (because of my ignorance). Many thanks for your answer, I was able to identify the wrong statement. Have a good day, Gilbert "Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> a écrit dans le message de news: hq1vub$nf***@south.jnrs.ja.net...Show quoteHide quote > On 12/04/2010 10:14, Gilbert Tordeur wrote: > >> An ASP.NET application reports the following error : >> >> ... >> [NullReferenceException: Object reference not set to an instance of an >> object.] >> RefFlu050.Page_Load(Object sender, EventArgs e) +1174 > >> How can I identify which statement in my source code corresponds to >> RefFlu050.Page_Load +1174 ? > > "+1174" denotes an offset into I.L. Code and not a line number. > > You know which routine the exception occurred in (RefFlu050.Page_Load), so > you can use ildasm to "pull apart" that particular method. The offsets > appear down the lefthand side, prefixed with "IL_": > > IL_001b: ldloc.1 > IL_001c: ldarg.1 > IL_001d: ldarg.2 > IL_001e: ldarg.3 > IL_001f: callvirt instance class [System.Data]System.Data.DataSet > [A.B.C.Processor]A.B.C.ID::E(string, > class [A.B.MiddleTier]A.B.C/ClientData, > class [A.B.Errors]A.B.IC&) > IL_0024: stind.ref > IL_0025: ldarg.3 > IL_0026: ldind.ref > > The "callvirt" entries are probably the most important ones, being calls > to others methods, hopefully ones that you wrote. > > HTH, > Phill W.
Defining a block of consecutive rows in a datatable
Odd Validator Problem Loop thru WinForm Controls Event of changing the grid-cell value. Change state of detached column of dataGridView. AutoFilter method of Range class failed Creating Drive Partitions Error 30366 in VB behind VS(2005) project Outlook like Calendar for VB net Copy Word Doc Bookmarks from One Document to another (VB.net) |
|||||||||||||||||||||||