10

sometimes I waste my time searching for a value in an object at runtime.
Certainly you-all know this task --> open the QuickWatch view and browse through the properties until you find what you're looking for.

I'm looking for a tool/add-in/extension where it is possible to search for a value in object.
The QuickWatch view with a search enhancement would be perferct :)

sb. knows a tool?

Thanks!

Renato Heeb
  • 719
  • 8
  • 18

2 Answers2

4

Immediate / Command window

A possible way to achieve that would be to write ? YourObject in Visual Studio's Immediate or Command window. This command will print all values of your object and you can then simply search it with Control + F.

Custom macro

Another possibility is to run a custom macro when a TracePoint was hit in Visual Studio like explained by Scott Guthrie in this excellent blog post:

The macro explained in this blog post automatically outputs all of the local variables when a TracePoint was hit, but the general idea would go in the same direction.

Martin Buberl
  • 45,844
  • 25
  • 100
  • 144
  • Good idea, thanks. I didn't think anything of it. But I'll detect my value only on the first level of my object. Further i want to search through my object recursively. – Renato Heeb Mar 14 '11 at 07:58
  • 1
    You're welcome! I'm not aware of any add-in or so to do what you want, but I added another possible solution to my answer using a custom macro. – Martin Buberl Mar 14 '11 at 08:27
  • incase if you have no idea on how to open command window shortcut is Cntrl+Alt+A source: http://www.dofactory.com/reference/visual-studio-shortcuts – Kurkula Mar 05 '17 at 22:03
  • sometimes command window will not show complete expanded results for internal objects. – Kurkula Mar 05 '17 at 22:05
2

Actually, I wrote a commercial extension to Visual Studio (called "OzCode") that does exactly what you're asking for - it's a "QuickWatch view with a search enhancement", as it replaces Visual Studio's QuickWatch with its own QuickWatch window that has a search box:

BugAid QuickWatch Window

Omer Raviv
  • 11,409
  • 5
  • 43
  • 82
  • Thank you. Is it possible to define the amount of levels to search through? – Renato Heeb Sep 06 '11 at 08:14
  • 1
    In the current version the amount of levels is hardecoded to 3, but in the next version (to be released soon) it will be configurable through the Options dialog. – Omer Raviv Sep 06 '11 at 08:17
  • 2
    It seems like BugAid website is down and been replaced by [OzCode](http://www.oz-code.com/) if I'm right. – vard Jan 19 '16 at 10:10