Reputation: 1877
Is there a way to add a watch to an instance of a object, instead to a variable? I have an object that is passed through various functions via parameters, and the parameters name may change in each function, so I'd like to add a watch that would be 'fixed' to that instance, regardless of the variable its currently assigned to.
Does anyone knows a way to do that? I'm using Visual Studio 2012.
Upvotes: 5
Views: 878
Reputation: 12328
When you add the item to the Watch window, try right-clicking on that entry and choose Make Object ID. Then add a watch for the particular ID (1#, 2#, etc.) See this link for more info.
Upvotes: 5