c# - How to determine reference equality of two variables in different scope? -


Assume that you are debugging at one point you are in method A, in which a parameter foo type Foo Later you are in Law B, which also takes a parameter of type Foo .

These two variables can be similar to Foo , but how can you tell? Because they are in different areas, you can not call contextExchange . Is there a way that you can get real memory space, point to the variable so that you can tell if they are examples?

I believe that you can use the object id feature Are there. More information can be found on this, but in a nutshell:

  1. Set up a breakpoint in your code where you can access the object variable which is in the scope.
  2. Hold your code and it at break points.
  3. In your local or auto window, right-click the object variable (note the value column) and select "Create object ID" from the context menu.
  4. You should now see a new ID number (#) in the Value column.

    After "mark" the object, you will see the assigned ID in the second call for Foo.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -