NullReferenceException with MyBase.New()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an object employee that is derived from person object. In .net 1.1 the
following procedure worked without any problem. In 2.0 i get the
nullreferenceexceptionerror. What could be going on here?

public class employee
inherits person

public sub new(info as string)
mybase.new(info) <<<<<<<<<<<<nullreferenceexception was unhandled by user
code (object reference not set to an instance of an object)
end sub

thx
dave
 
I don't believe there's anything wrong with your syntax.

Clearly there's simply a nullreference exception in your base constructor.

perhaps info is null? it's impossible to tell what else the problem could
be without knowing what the New(info as string) constructor of Person is.
 
Thank you Karl for your fast feedback.

Yes, you were right the base class (dll) had errors in it.

ty
 
Dave

Checkout base constructor and argument that you pass to clild
constructor (info).

B
 
Back
Top