Visual Studio Quick Tip

Execute Custom Code While Debugging In Visual Studio With The Immediate Window

The Immediate Window allows to execute code while debugging. Here is how you do it.

xeladu
Aug 31, 2022
Photo from Wikimedia, modified by author with Pixelied

You just hit a debugger breakpoint and want to execute some custom code that is not part of the actual code base? The Immediate Window is your friend 👍

Open it with the menu Debugging, then select Windows, and finally choose Immediate Window.

Type your code and press enter, it will be executed immediately.

Video of Immediate Window in Visual Studio by author

Be aware that you can only use imported namespaces. So if your compiler snapshot doesn’t contain an import for System.Collections.Generic, you can’t use IEnumerable<T>.

Find more tips for Visual Studio here:

Visual Studio Tips

14 stories

--

--

xeladu
xeladu

Written by xeladu

Flutter and Firebase expert, blogger on QuickCoder.org, find my ebooks and freebies on shop.quickcoder.org, contact me on me.quickcoder.org!

No responses yet