c# - How does the debugger get type information about an object initialized to null? -



c# - How does the debugger get type information about an object initialized to null? -

if object initialized null, not possible type information because reference doesn't point anything.

however, when debug , hover on variable, shows type information. static methods shown, still, seems know type. in release builds.

does debugger utilize other info reflection of sort find out datatype? how come knows more i? , if knows this, why isn't capable of showing datatype in nullreferenceexception?

it seems you're confusing type of reference type of value points to. type of reference embedded dll metadata , readily accessible debugger. there aditional info stored in associated pdb debugger leverages provide improve experience. hence null references debugger can determine info type , name.

as nullreferenceexception. tell type on querying field / method ... possibly. i'm not familiar internals of part of clr there doesn't seem inherent reason why couldn't so.

but i'm not sure added cost clr worth benefit. share frustration lack of info null ref exception. more type involved want names! don't care icomparable, wanted know leftcustomer.

names somethnig clr doesn't have access portion of them live in pdb , not metadata. hence can't provide them great reliability (or speed)

c# .net debugging

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -