Reputation: 21082
When you debug your program, and for example you set a breakpoint as in here:
void foo(string s)
{
(*) if (s=="bar")
...
}
(*) denotes breakpoint
you can move mouse cursor over "s" and inspect the content of it.
The question is how to do the same (i.e. inspect object) but not any argument or variable, but "this" object?
My case: I get exception at some point, I trace call stack, and let's say I would like to inspect "this" object of the 4th method of the call stack (for example).
Upvotes: 3
Views: 6253
Reputation: 62544
Quick Watch Window
this
Add Watch Window
Debug -> Windows -> Watch -> Watch 1
Name
field this
and press EnterImmediate Window
Debug -> Windows -> Immediate Window
this
and press EnterUpvotes: 5