joe_pool_is Posted August 19, 2004 Posted August 19, 2004 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. Quote Avoid Sears Home Improvement
Diesel Posted August 19, 2004 Posted August 19, 2004 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. Quote
Administrators PlausiblyDamp Posted August 19, 2004 Administrators Posted August 19, 2004 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 Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Moderators Robby Posted August 19, 2004 Moderators Posted August 19, 2004 If it's VB then place the following at the top of each code page.. option explicit on option strict on Quote Visit...Bassic Software
joe_pool_is Posted August 19, 2004 Author Posted August 19, 2004 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? Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.