Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
strauss_d_getting_started_with_visual_studio_2022_learning_a.pdf
Скачиваний:
123
Добавлен:
26.06.2023
Размер:
17.04 Mб
Скачать

Chapter 3 Debugging Your Code

Figure 3-59.  Application main screen

\ 9.\ On the remote machine, take whatever action is needed to hit the breakpoint you set earlier. I simply set a breakpoint behind the Start button click event handler. When you hit the breakpoint, it will be hit on your local machine (Visual Studio machine).

If you need any project resources to debug your application, you will have to include these in your project. The easiest way is to create a project folder in Visual Studio and then add the files to that folder. For each resource you add to the folder, ensure that you set the Copy to Output Directory property to Copy always.

Summary

In this chapter, we saw that Visual Studio provides a rich set of debugging tools for developers. Breakpoints provide a lot of flexibility when you need to pause your application and inspect the state of variables and other objects. Remote debugging allows developers to inspect the state of the application when running on a machine that is not under their direct control. The Diagnostic Tools also allow developers to inspect CPU and memory usage for their applications and help identify bottlenecks. In the next chapter, we will take a closer look at unit testing and how to create and run unit tests, using IntelliTest, and how to measure code coverage in Visual Studio.

214