That’s where you create a weak reference to any object, which can be evaluated from anywhere with $1, $2, and so on. You can use watch window evaluate the Object Id instance we talked about in Part 1. ![]() ![]() The most common scenario is with a breakpoint inside a loop. This happens if you hit the same breakpoint over and over again, or different breakpoints in the same class. ![]() While the DataTip and QuickWatch are more popular, the watch window is very useful when you need to re-evaluate the same variables and expressions multiple times. Right-click on a variable in the DataTip and choose “Add Watch”.Right-click on a variable choose “Add Watch” in the context menu.Write them manually in a new row of the Watch window.To add items to watch do any of the following: So if you write an illegal expression, you’ll see the same compiler error. The same rules apply to expressions as to code. There are 4 watch windows in Visual Studio, which you can use in different contexts (Watch 1, Watch 2, etc.).Īny expression can be entered into the watch window. It’s available from Debug | Windows | Watch | Watch 1 or Ctrl + Alt + W + 1. It’s kind of like the DataTip you get when hovering over a variable, except that you can write any expression you want. The Watch Window allows you to see value of variables and expressions while debugging. In this tutorial we will go over all the windows Visual Studio has for debugging. This included Breakpoints, Navigation through code, and Investigating variables with the DataTip and QuickWatch. ![]() In the previous tutorial, we saw some of the basics of debugging in Visual Studio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |