This feature is not available for Visual Basic.
Some applications create many instances of a class. In these applications, it is frequently useful to have an identifier to distinguish a given instance of the class. This can be useful, for example, if a specific instance of the class is not behaving as expected or a specific instance has been inserted more than once into a collection that should only contain it once.
With managed code, you cannot use the address of the object to identify it. Instead, you use an integer known as the object ID generated by the common language runtime (CLR) debugging services and associated with the object. This number is a positive integer generated by the CLR debugging services. The object ID value has no significance except to uniquely identify the object.
Object handles are displayed as variable-length, decimal integers, with the number sign (#) appended after the number, without any leading zeros, such as 5#. Handles appear in the Value column in different debugger data windows.
To create an object ID for a variable, right-click the variable, and select Make Object ID. The debugger will display a number with the pound (#) sign appended after it, such as 123#. To delete an object ID, right-click the variable, and select Delete Object ID.
When a breakpoint is hit, you can type a variable's handle into the Watch window. The debugger displays the value of the object ID, and you can expand and inspect it just like any other variable.
You can use the object ID to set a breakpoint on a method of a specific instance. For example, suppose you have an object that is an instance of class CMyType, and the instance has object ID 5#. Class CMyType includes a method aMethod. You can set a function breakpoint on method aMethod of instance 5# as follows:
((CMyType) 5#).aMethod
You can also use the object ID in a breakpoint condition. The following example shows how you can test the object ID in a condition.
this == 5#
For information about how to specify a breakpoint condition, see How to: Specify a Breakpoint Condition.