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

巧了我就是萌 提交于 2019-11-29 06:30:30

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:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!