Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Null Exception Referecne error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred - 25 Jul 2007 22:27 GMT
In my project I have a reference to a third party DK dll, at times when I
end the application I get an error stating "Null Exception Reference" and it
has the Dll's name. When I choose break it takes me to the Disassembly
screen. Can anyone advise of how to get rid of the error or how can I
determine where to begin looking for the suspect code based on what is
displayed in the Disassembly screen.

Thanks.

Fred
Peter Duniho - 26 Jul 2007 05:36 GMT
> In my project I have a reference to a third party DK dll, at times when I
> end the application I get an error stating "Null Exception Reference"  
> and it has the Dll's name.

I assume you mean a "NullReferenceException".

If you are passing the DLL a null reference when you shouldn't be, then  
the answer is to stop doing that.

If your own code is in the call stack, but it's not being caused by an  
incorrect parameter you've passed, then you may want to wrap the call with  
a try/catch block.  It won't fix the error, but at least your own  
application can detect the problem and do its best to continue to exit  
normally.

> When I choose break it takes me to the Disassembly
> screen. Can anyone advise of how to get rid of the error or how can I
> determine where to begin looking for the suspect code based on what is
> displayed in the Disassembly screen.

If your own code is involved, you can look at the call stack window to see  
how you got to the caller, and what parameters you passed (including  
checking for null parameters that shouldn't be).  The disassembly screen  
isn't going to tell you much of anything useful.  That is, if you're good  
at debugging you might be able to, after some hours or days of effort,  
figure out what the DLL is trying to do when it gets the exception, but  
that's usually not going to lead to a different solution than just looking  
at your own use of the DLL (I have personally had exceptions to that  
general rule, but they are extremely rare).

But the disassembly of the DLL isn't the interesting part.  The  
interesting part is how you got there and what your code is doing at the  
time.  That information you should be able to get by looking at the call  
stack, and if your code shows up there, double-clicking on the stack frame  
you want to see and looking at the state of your own code.

Pete

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.