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 


0
Gilbert
4/12/2010 9:14:30 AM
dotnet.languages.vb 830 articles. 0 followers. Follow

7 Replies
810 Views

Similar Articles

[PageSpeed] 27

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.tordeur@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
> 

0
Patrice
4/12/2010 9:34:43 AM
Gilbert Tordeur wrote:
> 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 
> 
> 

You put a debug brake point on the first line in Page_Load, and you 
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.
0
Mr
4/12/2010 12:05:52 PM
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.5004@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.tordeur@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
>>
> 


0
Gilbert
4/12/2010 12:24:45 PM
Gilbert Tordeur wrote:
> 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.
> 

Well, you need a try/catch in the area where you might think the problem 
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.

0
Mr
4/12/2010 1:38:30 PM
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...

--
Patrice

"Gilbert Tordeur" <gilbert.tordeur@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.5004@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.tordeur@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
>>>
>>
>
> 

0
Patrice
4/12/2010 1:56:16 PM
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.
0
Phill
4/13/2010 2:43:22 PM
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$nfp$1@south.jnrs.ja.net...
> 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. 


0
Gilbert
4/26/2010 1:40:59 PM
Reply:

Similar Artilces:

Error 339 in FRx for Drilldown viewer on Citrix.
First of all they are running FRx 6.7 with the latest service pack and the are using FRx in a Citrix environment. FRx Designer runs fine. Generating report to Drilldown viewer Component TList32p.ocx or one of its dependencies is not registered. I installed the latest patch and I tried to manually register the ocx file. Everything worked properly two days ago. According to the client, nothing was changed, but now there is an error. Please not they also re-installed the program and were still getting the error. Thanks, Scott ...

MSPUB.exe generates system errors
I attempt to launch a Publisher documnent and it gives an error "MSPUB.exe has generated errors and will shut down". What would cause this? I am running Windows 2000 sp4 and Office 2000 Professional sp3???? kevin wrote: > I attempt to launch a Publisher documnent and it gives an > error "MSPUB.exe has generated errors and will shut > down". What would cause this? I am running Windows 2000 > sp4 and Office 2000 Professional sp3???? ============================= Maybe the following KB article will offer some ideas: (243820) PUB2000 Errors When Saving Publication...

Error 1402.Setup--Cannot Repair--Code 57A Errors During Updates
Windows 7 64-bit, Office 2007 Enterprise edition Many people have reported this issue, but after 3 days and a dozen (wasted) hours, none of the sugestions I've read so far, have yet worked. Suite apps all work fine...it is just that for some of the "important updates", the install fails (Code 57A). When I try to repair off the DVD, I get the "...cannot open the registry key UNKNOWN\Components\(...)\(...) Verify that you have sufficient permissions..." Then I am directed to a file for instructions on how to contact Microsoft PSS--only the file...

Error adding shared mailbox OUTLOOK 2003
Hi im unable to add a shared mailbox, as soon as i click the ADD button i recieve this error:- The name could not be resolved. The action could not be completed. Thing is i cant add a name the error appears as soon as i click ADD. It will work on a few machines though? Any clues please. Logged in as you, using your Outlook profile you can add this mailbox with out issue? The reason I ask is because this is a common response/error if you do not have permissions to a mailbox. Another possibility is that the mailbox is offline and can not communicate with the Exchange server. Check ...

Access Violation (0xc000005) Error
Hi All, Im facing a typical problem since past two days. Earlier I got this problem when i was using Extende MAPI while opening strems. So I thought im doing some mistake when Im opening streams. So for the moment I left it a side and now im trying to copy a simple LPCSTR into stream. Still Im getting same access violation (0xc000005) error when im dealing with Streams.. So now im sure that im doing some mistake. But I dont know why the error is commin Exactly. So plz let me know why this error is commoing. Here Im pasting the code which describes what im doing. **** Is the ...

Word 2007 Email in message formating
I am trying to send an e-mail in the body of the message using a word 2007 document. Everytime I send it, it does not keep the same format as the word document. Is there any way to lock the document or should I try to create it using a different program? Thanks!! Emails are pretty much formatless, unless you go to html. You can Attach a Word document (and then it could get reformatted by the recipient's computer), or you could make it into and Attach a pdf, and then they'll receive it as you send it. On Feb 10, 11:21=A0am, Wayne <Wa...@discussions.microsoft.com> ...

Outlook publishing error
Until recently, I have been publishing my Outlook calendar and downloading to my iPhone. Recently, however, the service quite working and I am now unable to subscribe to the published calendar. Publishing appears to work fine but I now receive an error message on my iphone stating I am "Unable to suscribe". This worked fine previously and no changes have been made. Solutions? ...

Date Value Error
Hi, I am trying to calculate the number of days between 2 dates, I am sure in the past I have simply just did a formula to say date in cell 1 - date in cell 2, however I get a value error. The dates are formatted i nthe following way 18/11/2009 for example and I just need to calculate the number of days between 2 dates. Many thanks Paula Hi Paula, check if you don't have any spaces, simple formula should work =B1-A1 "Paula" wrote: > Hi, > > I am trying to calculate the number of days between 2 dates, I am sure in > the past I have simpl...

ActiveX Error
Whenever I go to compose an e-mail in Outlook 2003, I get the following popup: "Your current settings prohibit running ActiveX controls on this page. As a result, the page may not display correctly." Anyone know a fix for this error message? Thanks -Jeff are you using any addins or a signature? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook...

Error in using Export or Analyze With feature
Hi,I'm trying to copy and paste information (one row from a database into oneExcel spreadsheet at a time, to be saved as unique spreadsheets of one roweach, which will be edited by external clients and then pasted back into anAccess database) from Access into Excel. Each time I try, data is missing.I tried exporting the data from Access to Excel using File>Export as well asAnalyzing the data with Excel using Tools>Office Links>Anaylze it with Excel.Each time, I get the same problem: the data in certain fields cuts off at255 characters. In the original database, I have these fields...

Error Proofing
Goodmorning Everybody, My question is: "When I want a pivot field to change into the value I set on K I use: ActiveSheet.PivotTables("PivotTable3").PivotFields("ARF Code").CurrentPage = "" & k & "" However it can and will happen that the value set on k does not exist in the pivot field. When this occurs I want the macro to use the following code: ActiveSheet.PivotTables("PivotTable3").PivotFields("ARF Code").CurrentPage = "(blank)" How can I write such a thing down? Thanks in Advance! Jasper see your ...

Metadata Cache Error 06-14-04
I tried to go 'offline' from CRM sales for outlook. The error message: "Metadata cashe Error: no entity'. Although there are some answers in this group earlier, unfortunately the URLs which were pointed to are not right now. Help!! Hi Wes, Are any of your objects modified (i.e., have added fields?). Linda >-----Original Message----- >I tried to go 'offline' from CRM sales for outlook. The error message: "Metadata cashe Error: no entity'. Although there are some answers in this group earlier, unfortunately the URLs which were pointed to are not rig...

LDAP error
Hi, I'm testing a LDAP connection to my companies Active directory server and I'm getting the "An invalid dn syntax has been specified." error all the time. Here is my code: Dim entry As New DirectoryEntry() entry.Path = "LDAP://xxxxxx.company.se:389" entry.Username = "uid=MYAPP,ou=users,ou=internal,o=company" entry.Password = "yyyyyyyyy" entry.AuthenticationType = AuthenticationTypes.Secure Dim search As New DirectorySearcher(entry) search.ExtendedDN = ExtendedDN.Standard search.Filter = "(&...

DotNet plug-in
Hi there, Does anyone have experience in developing add-ins for the Store Op and wanna to share their experience ? I have coded a simple add-in under VS.net and as when I go the Store Manager's Addin menu to select the addin, the system complains that no application was found. any insights will be appreciated thank you, -Chris On Thu, 9 Dec 2004 10:19:19 -0800, "Chris" <dont@have.one> wrote: >I have coded a simple add-in under VS.net and >as when I go the Store Manager's Addin menu >to select the addin, the system complains that >no application was f...

Error message when backing up pst file
I have OL 2007 running on Vista - when trying to back up pst file get the following error code:0x80070021 The process cannot access the file because another process has locked a portion of the file. Can anyone explain this please? This is why Microsoft does NOT support the use of pst files over a network......You also run the very considerable risk of corrupting pst files that are accessed over a network. Put the files onto a local drive, and if you need to have them on a network location for daily backing-up then write a script to copy them after Outlook has closed. ...

outlook express 6, error on load
Recently have been getting the following error everytime I start Outlook express: msnmsgr has caused an error in kernel32.dll. msnmsgr will now close. I get the error 2 times, click on close, errors clear and outlook seems to work OK. How can I fix this? running Wme, outlook express 6 Thank you, Hi Mike, Msnmsgr is an executable file for MSN, are you an MSN subsciber? You should contact MSN regarding this error message. Regards, Scott Atkins MCSE, MCSA Partner Technical Lead - Outlook Microsoft Technical Support for Platforms and Business Applications -------------------- >Content-...

Error when sending e-mail (error in outbox) Error ID: 0x80191002
Unable to send or receive messages for the Hotmail Personal account. To send and receive messages in your Hotmail account, go to http://hotmail.live.com on the Web, or try again later. To get help from Windows Live Customer Support, go to http://support.live.com and click Windows Live Mail in the list of services. Subject 'Fw: name of attachment' Windows Live Mail Error ID: 0x80191002 Is there a solution to this problem? I got this problem when forwarding an e-mail to a friend. However, e-mail never leaves my outbox since error does not allow this e-mail to go. Hotm...

new message problem
When I open up the new message window, there is no subject line to fill out. What can I do to restore the subject line? Try View | Header. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Jim Faulkner" <anonymous@discussions.microsoft.com> wrote in message news:078601c47400$714bedc0$7d02280a@phx.gbl... > When I open up the new message window, there is no subject > line to fill out. What can I do to restore the subject > line? ...

Error in downloading statement to Money 2004
I am no longer able to download statements from my bank. I receive the following message: The Managed Software Installer failed to install the program associated with this file. Contact your system administrator. Then when I click ok the following error appears: Access to the specified device, path, or file is denied. I am a newbie wih Money 2004. I used the 98 version with no problems until my bank no longer supported that version. Can someone help me? Thanks in advance. In microsoft.public.money, Dawn wrote: >I am no longer able to download statements from my bank. I >recei...

IMF error
On Exchange SP1 I got in the Application log this error: Event Type: Error Event Source: MSExchangeTransport Event Category: SMTP Protocol Event ID: 7515 Date: 16/11/2005 Time: 11.20.47 User: N/A Computer: MY Server Description: An error occurred while Microsoft Exchange Intelligent Message Filter attempted to filter a message with ID XXXXX. This message will not be filtered. The error code is 0x800cce43. The mail was not delivered. Thanks. Riky ...

outllib.dll error
I am using outlook 2002 on a Windows 2000 Pro. SP4. Every time I click on the "NEW" button to create a new message, an error window appear stating that "Outlook has encountered a problem and need to close" and requesting to send the error report to Microsoft. I tried to do the following to no avail: 1- renamed oucmd.dat 2- renamed extand.dat 3- disabled every component in the Add-In manager. There was only one 4- renamed outlib.dll and ran repair from add/remove program 5- uninstalled Outlook, rebooted workstation and re- installed Outlook again. Following is the er...

using excel from dotnet
situation: I'm working on a new app in vbexpress 2008 using acad com interop Also need to write extracted data to excel. problem: At home(laptop) i have excel 10. At the office excel 12. (both seem to have excel5 listed in refs.) I need to work at both locations. can i reference both 10 and 12 in the same vbproj (i think not) can i just reference 5 and is that just an older version with common (but not the latest) interface? i guess i can just have 2 vbproj files (one on laptop one at work) and just copy the .vb class files that are being edited back and forth, not cop...

How to copy outgoing message into inbox PLUS view bcc's?
Hi guys, I like to file my in and outgoing mail into relevant folders, rather than have my outgoing messages sit in the "sent mail" folder. Up till now I've been achieving this by automatically cc'ing myself into messages but it's been filling up the mail server too quickly (because the messages also have to be downloaded to another computer they have to stay on the server). So now I've set up a rule to put a copy of every message in my inbox after sending but the problem with this is that I no longer have a record of who I sent bcc's to. How can I achieve this:...

Outlook error message 03-10-10
Outlook 2007 error messages sending and receiving mail: (0x8007000E): Out of memory or system resources. Close some windows or programs and try again. Nothing else is open or running. I have restarted, but still cannot send or receive messages in Outlook. Please help! Do a google search on: "0x8007000E" (quotes excluded) - no shortage of results identifying possible causes and solutions that worked for different people. Not a "one size fits all" answer to the problem. One of many starting points: http://office-outlook.com/outlook-forum/index.php/m...

Query error
I see the following error: Com Proxy: Error Loading File - The file may not exist or may be damaged. I receive the error when I click on the Leads screen. The error code is: Error Number: 0x80040E31 Any ideas? ...