One of the views used for debugging purposes in Visual Studio IDE and the VBA IDE. Can be used to display output at runtime, amend properties of variables and objects in break mode, and perform basic queries in break mode and design mode.
Questions tagged [immediate-window]
138 questions
8
votes
5 answers
How to determine type of a variable? (not the type of the object)
I'm in the immediate window in Visual Studio. There's a variable p. How can I deduce the type of the variable p?
I tried p.GetType() but that returns the type of object p. In my case, this is a very specific type (eg. sometimes ChessPlayer,…

Colonel Panic
- 132,665
- 89
- 401
- 465
8
votes
3 answers
Immediate Window in Design Mode
According to Microsoft: "The Immediate window is used at design time to debug and evaluate expressions, execute statements, print variable values, and so forth."
Notice it says "at design time". I have read other statements on the web to this effect…

Tom Collins
- 4,069
- 2
- 20
- 36
7
votes
2 answers
Weird Issue with DateTime calculation
I've probably been working too hard, but can someone explain to me the following, taken from the Immediate window?
(int)DateTime.Now.Date.DayOfWeek = 4
and
(int)DayOfWeek.Sunday = 0
and
(int)DateTime.Now.Date.DayOfWeek - (int)DayOfWeek.Sunday =…

immutabl
- 6,857
- 13
- 45
- 76
7
votes
1 answer
Execute Multiple Lines in the Immediate Window of an Excel VBA workbook
Am I limited to execute only 1 command in the Excel VBA Immediate Window. Is there a way to execute multiple statements?

satoukum
- 1,188
- 1
- 21
- 31
6
votes
2 answers
How can I print a range variable in the immediate window? Excel VBA
I'm attempting something that should be very simple. However I've just started learning today and and can't quite understand.
This is my code so far:
Public Sub getCellData()
Dim wb As Workbook: Set wb = ThisWorkbook
Dim ws As Worksheet: Set…

AP1
- 157
- 1
- 4
- 14
6
votes
3 answers
Write SqlDataReader to immediate window c#
I am trying to debug a SQL response which is throwing an error:
Conversion failed when converting the varchar value '0.01' to data type bit.
That does not make a lot of sense as object does not have any bools.
Code:
using (var connection =…

Matas Vaitkevicius
- 58,075
- 31
- 238
- 265
6
votes
2 answers
advanced Visual Studio kung-fu test -- Calling functions from the Immediate Window during debugging
I see some related questions have been asked, but they're either too advanced for me to grasp or lacking a step-by-step guide from start to finish (most of them end up being insider talk of their own experiment results). OK here it is, given this…

kizzx2
- 18,775
- 14
- 76
- 83
5
votes
1 answer
multithread debugging from immediate window
When I break into the debugger and call a function from the immediate window of VS2010 on the main thread, the function gets executed normally on the same thread. However, it appears other threads are not executed during that time of evaluation, as…

user492238
- 4,094
- 1
- 20
- 26
5
votes
2 answers
Visual Studio 2010: suddently Locals, Immediate Window and Watches don't work
I have this problem that a week ago, when debugging, suddently the "Locals" window is blank, the "Immediate Window" and Watches don't work and all return "Unable to evaluate the expression."
Also the standard debugger display stopped giving me any…

Rune Baess
- 216
- 2
- 7
5
votes
3 answers
Visualising lists in debug (or printing to immediate windows)
When I try to see the internal list of Dictionary item I hate to expand every single node one by one. I'm looking for an easier way to do this.
For example:
I've got a Dictionary object Dictionary(Of AnotherObject, Integer) and I want see a property…

dr. evil
- 26,944
- 33
- 131
- 201
5
votes
1 answer
Cannot use WinDbg and SOS in Visual Studio Immediate window
I'm following this tutorial: link. At step 8, when I say .load sos in the Immediate Window, it just pukes expected expression.
System: Win 7 x64, Visual Studio 2012 Premium.
I have an installed Debugging Tools for Windows (x64) 11/14/2012, Now I…

Csaba Toth
- 10,021
- 5
- 75
- 121
4
votes
3 answers
The Immediate Window
We use fluentmigrator and it wants a long for the migration number.
Normally I can just open the immedetiate window and type
System.DateTime.Now.ToString("yyyMMddhhmmss");
But sometimes it will say:
The expression cannot be evaluated while in…

Steve
- 25,806
- 2
- 33
- 43
4
votes
0 answers
Using linq Single() in Visual Studio Immediate window is not supported
When debugging a C# project in Visual Studio 15.8.7, I want to use Linq methods like Single() or FirstOrDefault() in the Immediate Window like this:
allGroups.Single(ag => ag.ImportId == importId)
However, I sometimes get an error message telling…

Thaoden
- 3,460
- 3
- 33
- 45
4
votes
1 answer
VS immediate window "identifier undefined" when querying DLL functions w/ namespace
I have some DLL exported functions that I'm trying to call from inside of VS2017 immediate window. The functions in the C++ header look like this:
namespace ma
{
bool MODEL_DECLSPEC ClearParameter();
bool MODEL_DECLSPEC GetResult();
…

buttonsrtoys
- 2,359
- 3
- 32
- 52
4
votes
1 answer
Displaying 2D array in visual studio debugger
I am working with Visual Studio 2005 and have a 2D array (say my2Dvar) that I would like to see the values of during run time. I am looking to export these values into Matlab. I tried displaying the values using ?my2DVar in the immediate window. But…

Dinesh
- 275
- 1
- 8