跟踪C#中的所有对象引用 [英] Track all object references in C#

查看:202
本文介绍了跟踪C#中的所有对象引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中调试时是否可以列出对象的所有引用.我正在使用C#.我正在寻找类似于垃圾回收期间GC所做的事情.

Is it possible to list all references of an object, while debugging in Visual Studio. I am using C#. I am looking for something similar to what GC does during garbage collection.

推荐答案

SOS可以为您完成此任务.它没有集成到调试器中,但是您可以将其附加到正在运行的进程中.您可能会发现使用SOSAssist很有帮助,而不是学习控制台语法. IIRC:

SOS can do this for you. It isn't integrated into the debugger, but you can attach it to your running process. You may find it helpful to use SOSAssist, rather than learning the console syntax. IIRC:

!dumpheap –type {type}

这篇关于跟踪C#中的所有对象引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆