Object Reference Not Set to an Instance of an Object

  • Thread starter Thread starter JC
  • Start date Start date
J

JC

I have installed a .net windows service application on an
WindowsXP Professional workstation. I have installed the
1.1 Framework ReDistributable package, SQL 2000 with SP3.
The program works great on my development machine and
another Windows 2000 machine that I installed it on
following the same pre-install steps with no problem.
The application makes a call to SQL to fetch DB settings
when the application starts. On this particular machine,
I get the following error message "Object Reference Not
Set to an Instance of an Object" when I start the
service.

I have cross-referenced to be sure all of the assemblies
are loaded on the machine.

Apparently, some dependency assembly must be missing. I
did create a deployment package and included all of the
detected dependencies.

Thanks.
JC
 
The error you describe is a null pointer exception.
Typically it is a bug or error in logic in your app code, not a missing
assembly.

What it means is that you have declared a variable and tried using it,
without assigning it.
Or, you have tried to use it after you have set it to null (or nothing).

If you compile with /debug+, and surround the offending code with a
try...catch, you will be able to print out the exception, which will
document the exact line number of the error.

try {
....
// do work here
}
catch (System.Exception ex1) {
System.Console.WriteLine("Exception!: " + ex1);
}


-Dino
 
Back
Top