I have a small .bat program that runs at night using VB.NET 4.0. The job use to run on a Window XP Service Pack 3. I tried to migrate the application to a Windows 2003 Service 3. The application failed stating System.Null exception. I followed the code and it seems to fail on initializing one of my class.
I used a .NET decompiler and I know the class is part of the executable, same assembly as the .exe. The same application works on Windows 7 and Window XP.
I am stumped.
Here is the code that is throwing the error
Public gobjLog as Log
Public Function Main(ByVal CmdArgs() As String) As Integer
gobjLog = New Log(databaseMgr)
Sample of the Log class
Option Strict On
Option Explicit On
Friend Class Log
Implements ILog, IDisposable
Public Sub New(ByRef database As IDatabase)
databaseMgr = database
IDatabase and ILog exist in the same assembly..
Hope this help
I'll assume that "SystemNull exception" actually means "Object not set to an instance of an object".
All you have to do is step through the code where it bombs and check to see which one of your objects returned Nothing. Your code is making the assumption that some call that is supposed to return an object returned an object when, in fact, it didn't. Then you tried to set a property or execute a method on that object, resulting in the error.
Since this appears to have something to do with logging, you might be trying to open a log file in a folder that the user does not have create/write permissions to. Depending on how your logging class' exception handling is setup, it may cause this problem.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)