在 VS 2010 中调试时序列化数据
在 Visual Studio (2010) 中调试时是否有某种方法(或某种扩展)来序列化对象?
我们有一个非常庞大的基于asp.net的应用程序,我的IIS曾经超时,直到我找到问题所在。我需要的是将一些对象存储到 json/xml/whatever 中并继续调试,以便稍后检查该对象值。在每个方法的每个迭代级别中验证每个对象需要花费太多时间,尤其是当问题处于最后阶段时。
is there some way (or some extension) to serialize object when debugging in Visual Studio (2010)?
we have really huge application based on asp.net and my IIS used to timed out, until I get the place, where problem is. What I need is to store some objects into json/xml/whatever and continue debugging so I can later check that objects values. It take too much time verifing every object in every iteration level in every method going through especially when the problem is at the very end.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,当我在调试时需要一些清晰的对象时,我会重写 ToString() 方法,该方法会更改手表中显示的内容。即
,您可能不会在手表中看到“MyNamespace.someother.MyClass”,而是看到类似“我的自定义 ToString 消息!”之类的内容。
如果您想存储输出,则必须编写自己的函数来执行此操作(然后确保在调试时调用它...您可以通过检查 System.Diagnostics.Debugger.IsAttached 有条件地执行此操作
Generally when I need some clarity of objects when debugging I override the ToString() method which changes what is displayed in the watch. ie
Instead of seeing "MyNamespace.someother.MyClass" in the watch, you may see something like "My custom ToString message!"
If you want to store the output, you would have to write your own function to do so (And then make sure it gets called when debugging... You could conditionally do this by checking System.Diagnostics.Debugger.IsAttached