Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have some code that I am trying to step through in my debugger.

 

I have set a breakpoint on my button's click event, but when I click this button I get an error before the debugger ever gets to the click event breakpoint.

 

 

 

Here is my error message:

An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module.

 

 

Additional information: Object reference not set to an instance of an object.

 

If I click Continue, my program terminates. If I click Break, I get the following message:

There is no source code available for the current location.

 

 

Does anyone know how I can go about fixing (or debugging) this? I am stumped. I can't even get the debugger to step into this.

Posted
Most likely there is some variable you forgot to delcare using new. Look in your variable declarations and fix it. If that doesn't work, post your code.
  • Administrators
Posted

What version of VS / Framework are you using? Have you tried rebooting your system and running the app again?

Are you declaring any Shared (static in C#) objects with shared constructors?

If it's not too large you could post the code here and see if anybody can help

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

PlausiblyDamp: I like that new avatar! :)

 

Q1. What version of VS / Framework are you using?

A1. VS 2003, Version 7.1.3088; Framework 1.1 Version 1.1.4322

 

Q2. Have you tried rebooting your system and running the app again?

A2. Yes. Sometimes, that seems to help. What does this mean? Also, once the error occurs once, it seems to happen more often. (pending another reboot)

 

Q3. Are you declaring any Shared objects with shared constructors?

A3. My form is a small part of a larger company project that has several programmer's fingers in it. I'm sure there are Shared objects. The only thing I am using in my portion of the code are grids and charts from ComponentOne.com. I'm wondering if their controls are having the problems and not mine, but I can't think of any way to prove this theory. (Maybe the DataGrid isn't reading correctly, etc.)

 

Q4. If it's not too large you could post the code here and see if anybody can help

A4. It is pretty big, and the main Project variables that I work with come from other forms from within the MDI form. I wouldn't be sure how to do that without posting everything. Even then, since I have the ComponentOne grid and chart, most of the others on here wouldn't be able to run it.

 

Diesel: "some variable you forgot to delcare using new." If that were the case, wouldn't the debugger break on that variable instead of giving me a "no source code available" message?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...