Using the Immediate Window while debugging your code
Immediate Window, which is present under the Visual Studio menu, Debug
| Windows
| Immediate
, and can also be invoked using keyboard shortcut Ctrl + D + I, is used while debugging an application. You will find it useful while executing statements, evaluating expressions, and/or printing any values present within the debugging context.
For example, let's take the preceding example to populate the employees
object. Once your debugging context has evaluated the said object, you can perform an operation on that object within the Immediate Window
.
In general, entering the object name employees
will print the object information available in that collection. When DebuggerDisplay
is set to the model class, entering the same employees
will print the entire details of the object in a formatted string as defined in the debugger display attribute.
You can also evaluate an expression by defining it in the Immediate Window
, if the same is available within...