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.
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.
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: