View C # generic type in debugger

When I hover over a generic type in Visual Studio using the debugger, I donโ€™t get the current type, there is a way to display it without accessing the direct window and typing ?typeof(T).Name ?

+6
source share
3 answers

You can view the types in the call window by looking at the top line, which will show the type of execution check.

I also want to emphasize for others your suggestion:

by going to the nearest window and typing ?typeof(T).Name

+6
source

You can see the full types of variables in the watch windows, such as "watch", "auto", "local". In addition, you can enable types in the call stack window (in the context menu of the context menu).

Here is an example for C ++ (works the same for C #):

Visual Studio Debug Session Interface Example with Full Types

+1
source

You can add an observer for typeof(T) .

+1
source

All Articles