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
263 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

16 Experts available now in Live!

Get 1:1 Help Now