When debugging, I was expecting two different classes to be using the same instance of an object. All of the properties were the same for these two objects, but they were two different instances. Is there a way to tell that in the VS debugger?
In order to tell for sure, I was able to add a field to the class:
private string someId = Guid.NewGuid().ToString();
Then, when debugging, I could at least look at that field for each of the two instances. Is there a better way that wouldn't involve having to create this dummy ID field?
set the break point on the dataset/datatable(f9 shortcut key for break point) and run your application (f5 is the shortcutkey ) When the break point comes mouse hover the dataset/datatable click on the glass shown in the hover image in visual studio . Note : check compilation debug="true" is true in web config .
Hover over a variable to see its value. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.
Arduino Nano boards have in-build USB that is can be used for the debugging purpose.
To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.
When debugging, in the Locals window, right-click on the instance and select "Make Object ID".
This will add number that is unique for this instance which is displayed whenever you see this instance in the debugger (in tool-tips as well as in the watch window).
Object.Equals Method (Object, Object)
Edit: To check reference equality use ReferenceEquals
Edit 2: While Debugging, Go to debug menu, windows --> immediate window (intellisense should work here) and ?Object.ReferenceEquals(obj1, obj2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With