Questions tagged [watch-window]

This tag refers to the watch window(s) of MS Visual Studio that is used to view variables during debugging.

32 questions
19
votes
1 answer

Auto-refresh in watch window in Visual Studio

Possible Duplicate: “This expression causes side effects and will not be evaluated”. How to suppress? I am using Watch window in Visual Studio. I have added some variables in Watch window. Sometimes to get the value while debugging I have to…
Brij
  • 11,731
  • 22
  • 78
  • 116
12
votes
1 answer

Debugger and Intellitrace show truncated text in text viewer for long SqlCommand.CommandText

I'm trying to find out what the text is of a select statement made against SQL Server using Entity Framework. The CommandText property under both IntelliTrace and the debugger truncate the text to exactly 4096 characters in the text view. Is there a…
Kit
  • 20,354
  • 4
  • 60
  • 103
8
votes
1 answer

VS2015 LINQ in debugger watch window

According to my source Debugging lamba expression with VS2015, LINQ should work in the debugger's watch window. However, I still receive the following error: error CS1061: 'IEnumerable' does not contain a definition for 'Where' and no…
D.R.
  • 20,268
  • 21
  • 102
  • 205
5
votes
2 answers

Watch window stopped accepting some usings

I am using the debugger to step through my code. The code file I’m in has usings at the top, including for example using System.Linq; In Visual Studio 2008 this used to apply to the Watch window while debugging, so I could use extension methods…
Timwi
  • 65,159
  • 33
  • 165
  • 230
4
votes
2 answers

Viewing contents of table variable when debugging in sql server 2012

In the watch window whilst debugging in Sql Server 2012, we get to see the values of regular variables, we can look at xml in a special window and same with sql strings, but for a table variable it just says (table). I'd really like to know if there…
toddmo
  • 20,682
  • 14
  • 97
  • 107
3
votes
0 answers

In MS Visual Studio watch window, how to format a function-returned int as 4 char values?

If I put an int into Visual Studio's watch window, I can use various format additions to display it in different ways. So if I have "int myVariable = 10;" in the code, I can put "myVariable,x" into the watch window to have it display as hex.…
srm
  • 3,062
  • 16
  • 30
3
votes
3 answers

Is there an equivalent of $exception for return values

In the Visual Studio watch window you can put $exception and get details of the current exception, but is there an equivalent for the methods return value?
ilivewithian
  • 19,476
  • 19
  • 103
  • 165
3
votes
3 answers

Is there a way to use Visual Studio's Watch Window in my own App?

I have a basic messaging application that takes requests from clients and returns them response objects. When I encounter a malformed request object I serialize it to a database log for failed requests in a binary field. I'd like to be able to…
Restore the Data Dumps
  • 38,967
  • 12
  • 96
  • 122
2
votes
0 answers

Can I show just a subset of a c# collection in the Visual Studio watch window?

I have a list of about 1000 items and I want to debug and examine in the watch window only items in the range 500 to 550. Is this possible in C# in Visual Studio? I tried items[500..550] but I got an error Predefined type 'System.Range' is not…
Tim Gradwell
  • 2,312
  • 5
  • 24
  • 25
2
votes
0 answers

Inline Lambda Expression in Watch Window

I usually need to write custom lambda expressions during debugging. As an example: (new Func(x => $"{commandParameters[x].ParameterName} : {commandParameters[x].Value}"))(2) or a shorter one: (new Func(x =>…
Mohsen Afshin
  • 13,273
  • 10
  • 65
  • 90
1
vote
2 answers

Accessing javascript from watch window in visual studio?

I'm missing the ability to do 'document.getElementbyId('foo')' and evaluate it or get a list of all the methods etc. when setting a break point in the code behind. Is this possible to get it from the watch window? (when I type 'document' in the…
1
vote
0 answers

Is expression evaluated differently in watch window to in the code execution

I have the following code which will check if a List is compatible with type IEnumerable. Covariance does not apply to value types, so this expression should evaluate to false. public class WatchWindowTests { [Fact] public void…
1
vote
1 answer

VS2010, column width of watch window

I can't see values of variables in my Watch window. I can see the variable names. I believe it's because the column width for variable name column is very wide. This problem exists for all watch windows. Quick Watch and Local shows values fine. I…
1
vote
1 answer

Visual Studio 2019 cannot view static variables defined at App level in Watch window

I have a Xamarin Forms app in Visual Studio 2019 and I have several static class variables defined in the App.xaml.cs file. I use these variables through out my application. However, when I am on a page of my app and add a property of the Static…
1
vote
1 answer

What does it mean when square brackets appear around a class name in the VS 2008 IDE?

In my watch window in VS2008, I'm looking at an IEnumerable. Expanding the IEnumerable, some elements are shown with a Value of {classX}. Others appear with a Value of {[classX]}. What's the difference? Why are there square brackets on some…
Mashmagar
  • 2,556
  • 2
  • 29
  • 38
1
2 3