Christopher Townsend
Christopher Townsend

Reputation: 1746

Visual Studio VB.Net Showing Nothing For Object

I am having a really weird issue with visual studio. I was wondering if anyone else had encountered it as its doing my head in.

Basically when i debug through the code it sometimes shows an object which has been successfully initialised as being Nothing, even though i can open it up and look at its initialised properties (see below)

enter image description here

What on earth is happening here. Plz plz plz help!!

Upvotes: 1

Views: 236

Answers (2)

GameAlchemist
GameAlchemist

Reputation: 19294

As Jon Skeet suggests, the string that is displayed in the debugger is the result of a call to ToString() on the object. So depending on the override of ToString, yes you can get Nothing for a non-null object.

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1500055

I suspect that ReasonItemLookup overrides ToString to return (say) the ID field - so if that's Nothing, that's what you'll see in the summary side of things.

Upvotes: 3

Related Questions