Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

searching a value in watch window

I'm debugging c# in visual studio

I added an object to the watch window

Given some value, is there any way to search which field holds this value?

like image 356
Elad Benda Avatar asked Jun 10 '12 08:06

Elad Benda


People also ask

Which Windows allows you to watch value entered?

The Watch Window allows you to see value of variables and expressions while debugging. It's kind of like the DataTip you get when hovering over a variable, except that you can write any expression you want. It's available from Debug | Windows | Watch | Watch 1 or Ctrl + Alt + W + 1.

How do I check the value of an immediate window?

To display the Immediate window, open a project for editing, and then choose Debug > Windows > Immediate or press Ctrl+Alt+I. You can also enter Debug. Immediate in the Command window. The Immediate window supports IntelliSense.


2 Answers

This is now natively supported in Visual Studio 2019

Searching for objects and properties in the Watch, Autos, and Locals Window by Leslie Richardson

VS Code Search

like image 189
KyleMit Avatar answered Nov 09 '22 05:11

KyleMit


I'm afraid there is no such built in search functionality in the VS2010 watch window (although the watch window has a lots of cool features).

See also this unresolved question: Searching for text in an Object watch window in visual studio

However there are some commercial extensions which offers that functionality.

E.g.: Excerpt from the OzCode VS extension feature list:

Search

When debugging objects and collections, you are often looking for a specific property or field, or a value held within a property or field. Unfortunately, this usually involves either a lot of clicking and scrolling, or writing custom debug-specific code. Finding items even in simple structures is not easy, not to mention doing so in a complex object graph. With our “Search” feature, this is no longer the case.

like image 30
nemesv Avatar answered Nov 09 '22 06:11

nemesv