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
262 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
ID: 33747320
You probably don't have some third party control (eg. crystal reports) installed on the other machine.
0
 

Author Comment

by:prgMan
ID: 33747557
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
ID: 33748017
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
ID: 33748341
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 250 total points
ID: 33748387
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
ID: 33751346
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
ID: 33756239
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
ID: 33756255
Quick & great answers guys, thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

15 Experts available now in Live!

Get 1:1 Help Now