473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Default property display in debug windows

I have a recollection that there is some way (an attribute on the class,
perhaps) that tells the VS.net debugger to display a particular property in
the Auto / Locals window when I'm viewing a particular type of object...

For example, if I have a class:

public class X
{
private int myValue = 1;

public string ToString()
{
return myValue.ToString();
}
}

if I have an instance of this class and I view it in the debugger with the
Auto / Locals window, I see the "Value" as {NameSpace.X}. What I want to
see there instead is "1" (or whatever myValue is). I thought there was an
attribute, but maybe it's something else... anyone know?

-mdb
May 3 '06 #1
5 1642
Michael,
I have a recollection that there is some way (an attribute on the class,
perhaps) that tells the VS.net debugger to display a particular property in
the Auto / Locals window when I'm viewing a particular type of object...


System.Diagnostics.DebuggerDisplayAttribute in .NET 2.0
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
May 3 '06 #2
You are not overriding ToString()

oX.ToString() retruning the default ToString() in the base? the NameSpace.X

SA
"Michael Bray" <mbray@makeDIntoDot_ctiusaDcom> wrote in message
news:Xn****************************@207.46.248.16. ..
I have a recollection that there is some way (an attribute on the class,
perhaps) that tells the VS.net debugger to display a particular property
in
the Auto / Locals window when I'm viewing a particular type of object...

For example, if I have a class:

public class X
{
private int myValue = 1;

public string ToString()
{
return myValue.ToString();
}
}

if I have an instance of this class and I view it in the debugger with the
Auto / Locals window, I see the "Value" as {NameSpace.X}. What I want to
see there instead is "1" (or whatever myValue is). I thought there was an
attribute, but maybe it's something else... anyone know?

-mdb

May 3 '06 #3
Mattias Sjögren <ma********************@mvps.org> wrote in
news:Ob**************@TK2MSFTNGP03.phx.gbl:
Michael,
I have a recollection that there is some way (an attribute on the
class, perhaps) that tells the VS.net debugger to display a particular
property in the Auto / Locals window when I'm viewing a particular
type of object...


System.Diagnostics.DebuggerDisplayAttribute in .NET 2.0


Ah thanks, but I should have specified... VS.net 2003. anything similar
or am I just out of luck?

-mdb
May 3 '06 #4
>Ah thanks, but I should have specified... VS.net 2003. anything similar
or am I just out of luck?


IIRC, your options there are to override ToString or to modify the
<VSdir>\Common7\Packages\Debugger\mcee_cs.dat file.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
May 3 '06 #5
Mattias Sjögren <ma********************@mvps.org> wrote in
news:e2**************@TK2MSFTNGP03.phx.gbl:
Ah thanks, but I should have specified... VS.net 2003. anything
similar or am I just out of luck?


IIRC, your options there are to override ToString or to modify the
<VSdir>\Common7\Packages\Debugger\mcee_cs.dat file.


I had already overriden ToString(), but modifying the mcee_cs.dat file
worked like a champ... In fact, I'm changing a whole bunch of stuff in
that file (now my DateTime's show hour/minute/second as well as
date/month/year!!! WWOOOOOOOHOOOOO!!!!!)

-mdb
May 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob R. Ainscough | last post by:
I have an interesting problem that is either a bug or just some local issue with my PC (probably the later). If I place my cursor on a word and hit F1 for help, it goes thru a process (see a...
0
by: Wendy Elizabeth | last post by:
When I am using Visual Studio.net in the debug mode, I want to be able to increase the size of values that can be displayed. For example when using the "watch" or other debug windows, I know I want...
1
by: Wayne | last post by:
I'm using the following code from the Access Web to open a folder. The folder opens in "List" View. Is there an addition that I can make to the code to force the folder to open in "Details" view?...
7
by: NCrum | last post by:
I want to set the Default value of a Combobox for any changeable record and have got this working but it is totaly unsatisfactory see the code below I loop through the items in the Combo looking...
3
by: Agnes | last post by:
In a single form , I can delcare a public vairable or property. So. What is the difference between it ?? which is better ?? Dim frmTest as myForm frmTest.strPublicVariable = "ABC"...
4
by: sherifffruitfly | last post by:
Hi, I'm using StatusBar text to inform the user what's going on in the application. I pass a reference to from the main form's class to other (instances of) classes that are doing the actual...
0
ADezii
by: ADezii | last post by:
The motivation for this Tip was a question asked by one of our Resident Experts, FishVal. The question was: How to Declare Default Method/Property in a Class Module? My response to the question was...
36
by: beebelbrox | last post by:
Hi, I am new VB programming in Access and I am requesting help with the following code. WIndows OS MSaccess 2003 This code is attached to an unbound form that will display a specific recordset...
12
by: Anil Gupte | last post by:
I wrote my Windows Service first as a regular Windows Exe because it is easier to debug. In that I used AppDir = Application.ExecutablePath.Substring(0,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.