Attribute to mark variable as tooltip during debug?

G

Guest

I was wondering... Are there attributes you can use to mark
accessors/variables that will identify them as to be shown when hovering over
an instance of the containing object during debugging? As in, if you have a
class with lots of different instance variables, but you are interested in
seeing the value of variable "foo" when you hover the mouse over an object of
the class during debugging, similar to seeing the current value when hovering
over an int var? For example, in class MyObject, I would do something
similar to:

class MyObject{
int bar;
[SeeMeWhenHoveringDuringDebugChaChaCha] // <-- something like this
static string status = "Your program is going to crash, cha cha cha!";
bool fubar = true;

public MyObject(){
...

Is it possible? My watch list is getting a scosh too long for comfort...
 
N

Nicholas Paldino [.NET/C# MVP]

William,

In .NET 2.0 and VS.NET 2005 and above, you can attach the
DebuggerDisplayAttribute to your class, and specify the format of what is
seen for that variable when you hover over it.

In .NET 1.1 and VS.NET 2003 and before, you have to modify the
mcee_mc.dat file in the <program install
directory>\Common7\Packages\Debugger directory. There is documentation in
the file detailing how to set those values.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top