简体   繁体   English

跟踪 C# 中的所有 object 引用

[英]Track all object references in C#

Is it possible to list all references of an object, while debugging in Visual Studio.在 Visual Studio 中调试时,是否可以列出 object 的所有引用。 I am using C#.我正在使用 C#。 I am looking for something similar to what GC does during garbage collection.我正在寻找类似于 GC 在垃圾收集期间所做的事情。

SOS can do this for you. SOS 可以为您做到这一点。 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.您可能会发现使用 SOSAssist 比学习控制台语法更有帮助。 IIRC: IIRC:

!dumpheap –type {type}

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

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