Solved

C# Isolate what is missing from error message: Object reference not set to an instance of an object.

Posted on 2010-09-23
8
261 Views
Last Modified: 2013-11-07
Experts,
Is there a way to determine what libraries and Excecutable is using and where it is getting the library from?

I am receiving an  error on a server:
Object reference not set to an instance of an object.

Yet it works fine on my laptop.  So I'm baffled as to what is missing.
0
Comment
Question by:prgMan
  • 4
  • 2
  • 2
8 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
You probably don't have some third party control (eg. crystal reports) installed on the other machine.
0
 

Author Comment

by:prgMan
Comment Utility
Thank you for quick reply.

Is there anyway to isolate or open EXE to figure out what is missing?  I am trying to rebuild the server clean so I am trying to avoid installing without being sure it is necessary.  Unfortunately it is a server and not a VM so I can't just drop a bunch stuff and then back it out till it works.  

Knew I should have listened to mother, said I should become a brain surgeon, you don't bring your work home with you then.  But no, I had to like programming.....
0
 
LVL 33

Expert Comment

by:Todd Gerbert
Comment Utility
It's a Windows application (i.e. not an ASP.Net website)?  You have access to the source project?  Ideally, you could modify the program to catch exceptions and either log, or display, additional details - the exeception undoubtedly contains more detail, like the stack trace, offending source file and line number.
0
 

Author Comment

by:prgMan
Comment Utility
It is a windows application (sorry should have mentioned).  I do have the source code, the PM is reluctant to let me modify till we get the contractor to turn everything over.  Unfortunately at same time they want me make it work.  I'll take a look at your suggestion.  Your right, unfortunately in this case politics is a problem.  Is there a trace app that can be put with an already compiled app to see where things are going?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 250 total points
Comment Utility
You could try attaching a debugger - I'm not sure how useful that will be if the executable image was compiled without Debug information - but since .Net compiles to IL and not byte-code you may get something useful.
Start the program, and in Visual Studio you can open the Debug menu and use Attach to Process...
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 250 total points
Comment Utility
Where / when does this message appear - that should give you a very strong hint at the source of the problem.  

eg. You click a button to display a crystal report file in a form and boom!  So you know which form is giving the problem, look at the design and see what is there.

eg. You click a button to run a piece of code and boom!  So you look at the code, maybe comment out a section then try again.
0
 

Author Comment

by:prgMan
Comment Utility
Its a console application triggered by batch file.  It stops pretty quick, problem is the log files don't list what steps passed, didn't pass.  So I can't tell which one it stops. I did as recommended above and added some extra logging.  I can now see where it is breaking.

Thanks again
0
 

Author Closing Comment

by:prgMan
Comment Utility
Quick & great answers guys, thanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now