[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
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
Medium Priority
?
274 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 45

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Assisted Solution

by:AndyAinscow
AndyAinscow earned 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

834 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