开发者

search for a value in an object at runtime [QuickWatch enhancement]

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!


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:

  • Debugging Tips with Visual Studio 2010 (TracePoints – Running a Custom Macro)

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.


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:

search for a value in an object at runtime [QuickWatch enhancement]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜