Check WeakReference Target Reference Count

.net, c#, weak-references

Solution

No - this is determined by whether the object has a GC root. The GC does not determine this until it runs.

Have a look at this MSDN magazine article (part one and part two) for some more information about the GC in .Net.

** Update ** Thanks @Adriano for part 2 link.

Problem

I know that if an object had no reference, and the GC cleared it, the object's WeakReference.Target property would return null, But suppose the object has no strong reference, but the GC didnt clear it yet, is there anyway to check through its WeakReference whether or not it has any strong-references?

Original source