Immediate Window - A forgotten tool

A tool that is integrated into Visual Studio that people often forget about is the Immediate Window. The Immediate Window will allow you to evaluate expressions while debugging. For example, rather than using the visual tool to examine the item within a collection, you can just issue a command in the Immediate Window. Such as:

immediate2.png

Intellisense is also supported:

immediate1.png

You can also do intermediate calculations:

immediate4.png

But sadly, no query (LINQ) expressions:

immediate5.png

By default, this window should show up when running in deug mode. If not, the default keyboard shortcut (for 2008) is Control-D,I. Joe left a comment that Control-Alt-I is also valid, which works in 2005.

For non Express users, also check out the Command Window for more goodness.

Added:
Also, check out this post about the Watch Window at Von#.

kick it on DotNetKicks.com

10 Responses to “Immediate Window - A forgotten tool”

  1. DotNetKicks.com Says:

    Immediate Window - A forgotten tool…

    You’ve been kicked (a good thing) - Trackback from DotNetKicks.com…

  2. Matt Briggs Says:

    Whats funny is that I just discovered this myself about two days ago (Im a fairly recent .net convert). Good job spreading the word, absolutely indispensable tool.

  3. Joe Says:

    Ctrl + Alt + I brings it up too.
    Ctrl + Alt + A should be your next post — <3 the command window

  4. Daily Bits - February 29, 2008 | Alvin Ashcraft's Daily Geek Bits Says:

    [...] Immediate Window - A Forgotten Tool (null) [...]

  5. Tim B Says:

    You can make assignments in the immediate window as well:

    words.Count
    1

    words.Add(new Word())

    words.Count
    2

  6. fm Says:

    Good point Tim B, thanks.

  7. Wöchentliche Rundablage: ASP.NET MVC, ASP.NET, Windows Live, Silverlight 2, LINQ, C# 3.0, CardSpace… | Code-Inside Blog Says:

    [...] Immediate Window - A forgotten tool [...]

  8. The Command Window | Oh Null! Says:

    [...] Command Window, like the Immediate Window, can be one of those tools that a developer can find to be an invaluable aid and time saver. As the [...]

  9. George Says:

    I’ve lived by the immediate window for years. But it drives me mad that Visual Studio hides it so effectively. I spend ages looking through obscure debug windows lists, but can never find it (C# hides it away, whereas VB.Net shows it!)

    Thanks Joe for the Ctrl-Alt-I combination!

  10. Carlo Mendoza Says:

    I always wondered what that windows was all about. Now I know. Thanks.

Leave a Reply