The default for complex types is to just display the type name in the debugger’s watch window. Some system types however display the values of one or more properties instead of the type name. What is displayed is configurable which also makes it possible to show more information about user-defined types. This is how it’s done:
- Edit C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger\mcee_cs.dat for C#, mcee_mc.dat for managed C++, vjsee.dat for J#. Sorry, no VB!
- Add/modify rows in the file. Each row describes how a type should be displayed. Example:
<System.DateTime>=<Year>-<Month>-<Day> <Hour>:<Minute>:<Second>
- The first part is the type name, followed by ‘=’. The rest of the line contains property names surrounded with ‘< ' and '>‘, mixed with fixed text that is displayed as it is.
The example above will display DateTime values as "{2005-4-23 16:2:51}"
.
In addition to property names, one can also use expressions and method names.
Note: This has not yet been tested with Visual Studio 2005.