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

查看:27
本文介绍了在 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 比学习控制台语法更有帮助.国际研究中心:

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天全站免登陆