If you are processing objects in the Watch window and want to check the current generation of that object, you can easily get it by calling GC.getGeneration(YourObjectName).

01 Get Object Generation using Watch Window - https://codeconfig.in

Must read:




If you create an object ID in a view window, such as (image #1 above), you can also see the generation of a newly created object ID GC.getGeneration(#id)

21 Get Object Generation using Watch Window - https://codeconfig.in

I hope you learned new thing and will use this in your daily development practices. You can check more articles on our website under C# section HERE or you can also check same on Microsoft Docs too.

Leave a Reply

Your email address will not be published. Required fields are marked *

Explore More

Working With File Class In C#

In C#, ‘File’ class provides many static methods for moving, copying, and deleting files. These Static methods involve moving a file and copying and deleting a file also. Let’s check

How to Read a Text File in C#

In C# ‘File’ class provides static methods to read given text file data. The File.ReadAllText() method opens a text file, reads all the text present in the file into a

C# | How to use Interface references

In C#, you’re permitted to make a reference variable of an interface type or in other words, you’re permitted to form an interface reference variable. Such kind of variable can