[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register 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
?
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

650 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