You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visual Studio provides very powerful tools to help you debug and diagnose issues in your applications. These tools are especially valuable for analyzing state and tracking down bugs while your application is running.
1
+
Visual Studio provides powerful tools to help you debug and diagnose issues in your applications. These tools are especially valuable for analyzing state and tracking down bugs while your application is running.
2
2
3
3
:::image source="../media/visual-studio-tools.png" alt-text="Screenshot of Visual Studio debugging tools.":::
4
4
5
-
## Fix Bugs Before the Application Launches
5
+
## Fix bugs before the application launches
6
6
7
-
Suppose that you work for a team that's building a new application, but you keep finding bugs in the code. The team would like to find and fix all of these issues before the app goes live. However, the issues are too subtle or complex to diagnose just by reading the code. You're looking for additional tools and assistance to track down problems while the app is running with different inputs and parameters.
7
+
Suppose that you work for a team that's building a new application, but you keep finding bugs in the code. The team would like to find and fix all of these issues before the app goes live. However, the issues are too subtle or complex to diagnose just by reading the code. You're looking for tools to assist you in tracking down problems while the app is running with different inputs and parameters.
8
8
9
-
## What will we be doing?
9
+
## What are you going to do?
10
10
11
-
This module shows you how to use the Visual Studio debugger with a .NET program. You'll learn how to leverage common features like break points and step through your code line by line. You'll also learn how to inspect the state of your program as it executesusing tools like the Watch and Locals windows. Finally, you'll also use diagnostic features like the Call Stack and Traces to review code execution in greater depth.
11
+
This module shows you how to use the Visual Studio debugger with a .NET program. You learn how to use common features like break points and how to step through your code line by line. You also learn how to inspect the state of your program as it executes, by using tools like the Watch and Locals windows. Finally, you learn how to use diagnostic features like the Call Stack and Traces to review code execution in greater depth.
12
12
13
13
:::image source="../media/visual-studio-intro.png" alt-text="Screenshot of Visual Studio debugging in action.":::
14
14
15
15
## What's the main goal?
16
16
17
-
By the end of this module, you'll understand how to use Visual Studio's debugging tools to analyze and fix issues in your application code.
17
+
By the end of this module, you understand how to use Visual Studio's debugging tools to analyze and fix issues in your application code.
Copy file name to clipboardExpand all lines: learn-pr/language/dotnet-debug-visual-studio/includes/2-debugger.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,31 +2,29 @@ During your journey as a developer, there's always *that* moment when you end up
2
2
3
3
> Why isn't my code working?
4
4
5
-
Asking this question is a normal part of any developer's day. The trick is to get comfortable with finding and fixing your bugs with a minimum of time and frustration. When there's a bug in your program, everyone usually has their own way of dealing with this problem.
5
+
Asking this question is a normal part of any developer's day. The trick is to get comfortable with finding and fixing your bugs with a minimum of time and frustration. When there's a bug in your program, do you deal with it in one of these ways?
6
6
7
-
You probably already have tried one or more of these debugging approaches yourself:
8
-
9
-
- Try running your program again because it *should* work.
7
+
- Run the program again because it *should* work.
10
8
- Explain your issue to a rubber duck.
11
-
- Read through your code again to find out the issue.
9
+
- Read through your code again to find the issue.
12
10
- Take a walk outside.
13
11
- Spam a few `Console.WriteLine("here")` messages in your code.
14
12
15
-
You might have various degrees of success with these methods. The one approach that's commonly regarded as being more often successful is using a debugger. But what's a debugger exactly?
13
+
You might have various degrees of success with these methods, but one approach is commonly regarded as being the most successful. Using a debugger. But what exactly is a debugger?
16
14
17
-
A debugger is a software tool you can use to observe and control the execution flow of your program with an analytical approach. Its design goal is to help find the root cause of a bug and help you resolve it. It works by either hosting your program in its own execution process or running as a separate process that's attached to your running program, like .NET.
15
+
A debugger is a software tool you can use to observe and control the execution flow of your program with an analytical approach. Its design goal is to help you find the root cause of a bug and help you resolve it. It works by hosting your program in its own execution process. Or, by running as a separate process attached to your program, like .NET.
18
16
19
-
Debuggers come in different flavors. Some work directly from the command line while others come with a graphical user interface. In this module, we'll use Visual Studio's integrated graphical debugger.
17
+
Debuggers come in different flavors. Some work directly from the command line while others come with a graphical user interface. In this module, we use Visual Studio's integrated graphical debugger.
20
18
21
19
## Why use a debugger?
22
20
23
-
If you're not running your code through a debugger, that means you're probably *guessing* what's happening in your program. The primary benefit of using a debugger is that you can *watch* your program running. You can follow your program execution one line of code at a time. In this way, you avoid the chance of guessing wrong.
21
+
If you're not running your code through a debugger, it means you're probably *guessing* what's happening in your program. The primary benefit of using a debugger is that you can *watch* your program running. You can follow your program execution one line of code at a time. In this way, you avoid the chance of guessing wrong.
24
22
25
23
Every debugger has its own set of features. The two most important ones that come with almost all of them are:
26
24
27
-
-*Controlling your program execution*. You can pause your program and run it step by step, which allows you to see which code is executed and how it affects your program's state.
25
+
-*Controlling your program execution*. You can pause your program and run it step by step, which allows you to see which code is executing and how it affects your program's state.
28
26
-*Observing of your program's state*. For example, you can look at the value of your variables and function parameters at any point during your code execution.
29
27
30
-
Mastering debugger usage is an important skill for a developer that's often overlooked. It makes you more efficient at hunting bugs in your code and can help you quickly understand how a program works.
28
+
Using a debugger effectively is an important but overlooked skill for a developer. It makes you more efficient at hunting bugs in your code and can help you quickly understand how a program works.
Copy file name to clipboardExpand all lines: learn-pr/language/dotnet-debug-visual-studio/includes/3-analyze-your-program-state.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@ In the previous unit, you learned that a debugger helps you control your program
2
2
3
3
Let's start by learning how to use the Visual Studio debugger with .NET.
4
4
5
-
## Getting Started with the Visual Studio Debugger
5
+
## Getting started with the Visual Studio Debugger
6
6
7
-
Launch the application with the debugger attached using the **Start** button at the top of Visual Studio, which now includes our project name. Once the app is running, more debugging tools and features become available.
7
+
Use the **Start** button in the Visual Studio command bar to launch the application with the debugger attached. Notice that the command bar now includes our project name. Once the app is running, more debugging tools and features become available.
8
8
9
9
:::image source="../media/visual-studio-debugging-controls.png" alt-text="Screenshot of Visual Studio debugging controls.":::
0 commit comments