Get an exception of System.NullReferenceException for concrete class inherited abstract class


#1

Hi guys,

I have an email class implementation SysEmail which is inherited the AbstractEmailer mailer. I tried to call my SysEmail like

Dim mailer = New SysEmail
Dim type = mailer.GetType()
Dim method = type.GetMethod("Send")
Dim job = New Job(type, method, "email@ss.com",
                              "Hello From Background Service",
                              "Hello content from background service",
                              "noreply@c.com",
                              "-" )
Dim client = New BackgroundJobClient()
client.Create(job, New EnqueuedState())

it threw an exception of

{"FailedAt":"2018-04-11T06:26:41.5544616Z","ExceptionType":"System.NullReferenceException",
"ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionDetails":"System.NullReferenceException: 
Object reference not set to an instance of an object.\r\n   at Sys.Abstract.AbstractEmailer.Send(String StrTo, String StrSubject, String StrMessage, String StrFrom, String StrName) 
in C:\\MySoftwareDevelopment\\SmpBersepaduProject\\SmpBackend\\Sys.Abstract\\AbstractEmailer.vb:line 71\r\n   
at Sys.Business.Common.SysEmail.Send(String StrTo, String StrSubject, String StrMessage, String StrFrom, String StrName) 
in C:\\MySoftwareDevelopment\\SmpBersepaduProject\\SmpBackend\\Sys.Business\\Common\\SysEmail.vb:line 37"}`

as for additional info, the abstract class (AbstractEmailer) also dependent on other dll library. beside that, this implementation done using .NET Webform 4.6.1.

Hope you guys can give me any workaround on this problem.