简体   繁体   English

在visual studio中的Object watch窗口中搜索文本

[英]Searching for text in an Object watch window in visual studio

I am using visual studio 2010. I have set a breakpoint and added a watch on a complex object with very deep hierarchy. 我正在使用visual studio 2010.我设置了一个断点,并在一个具有非常深层次结构的复杂对象上添加了一个监视。 I was wondering if there was any quick way to search this object tree for a particular string I want. 我想知道是否有任何快速方法来搜索此对象树以查找我想要的特定字符串。 Either as a property/value/method etc. In other words, I just want to say "Does this object have anything like "Foo" in it. I don't care what it is, just tell me if it knows about "Foo". Give me all instances of "Foo"." 无论是作为属性/价值/方法等等。换句话说,我只想说“这个对象有没有像”Foo“这样的东西。我不在乎它是什么,只要告诉我它是否知道”Foo“ “。给我所有”Foo“的例子。”

For example, if I have an object containing 3 Dictionaries and 4 XML elements, when I break and add watch on the object and search for "Foo", I want to find out that list 2 has a string with "Foo", List 3 has an Object "Bar" which has property "Foo" and XMLElement 1 has a child "Foo" 例如,如果我有一个包含3个字典和4个XML元素的对象,当我在对象上打破并添加监视并搜索“Foo”时,我想知道列表2有一个字符串,其中包含“Foo”,列表3有一个对象“Bar”,其属性为“Foo”,而XMLElement 1有一个子“Foo”

Is there any powerpack plugin, commercial plugin or some other extension of visual studio that would let me do this? 是否有任何powerpack插件,商业插件或视觉工作室的其他扩展,让我这样做?

To give you some context. 给你一些背景信息。 I am evaluating various PDF parsing components to parse various PDFs. 我正在评估各种PDF解析组件来解析各种PDF。 I am trying to extract certain custom tags, pdf content and various other artifacts etc. While doing this, once the pdf is read and parsed, it would be nice to search the object and say something like does this know anything about the text "My Signature"... hmm.. nope. 我正在尝试提取某些自定义标签,pdf内容和各种其他工件等。在执行此操作时,一旦读取并解析了pdf,搜索对象并说出类似文本的内容“My My签名“......嗯..不。 Ok. 好。 Lets call this "ConvertToHTML" method to get object B. Does object B know anything about "My Signature" etc. 让我们调用这个“ConvertToHTML”方法来获取对象B.对象B是否知道有关“我的签名”等的任何信息。

Any help would be greatly appreciated. 任何帮助将不胜感激。

一个建议是序列化整个对象并对序列化字符串进行正则表达式搜索。

Visual Studio 2019 Visual Studio 2019

This is now natively supported in Visual Studio 2019 现在, Visual Studio 2019本身支持此功能

Searching for objects and properties in the Watch, Autos, and Locals Window by Leslie Richardson Leslie Richardson 的Watch,Autos和Locals窗口中搜索对象和属性

VS代码搜索

OZ Code OZ代码

There is also a commercial Visual Studio Extension called OzCode which has lots of debugging experience enhancements including search : 还有一个名为OzCode商业 Visual Studio扩展,它具有许多调试经验增强功能,包括搜索

OZ代码搜索

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM