Skip to content

Commit 1fc3a75

Browse files
Merge pull request #50574 from v-thpra/azure-triage-fix-1055016
Technical Review 1055016: Interactively debug .NET apps with the Visual Studio debugger
2 parents 00cd45d + f9e6a6c commit 1fc3a75

File tree

10 files changed

+111
-113
lines changed

10 files changed

+111
-113
lines changed

learn-pr/language/dotnet-debug-visual-studio/8-knowledge-check.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uid: learn.dotnet-debug-visual-studio.knowledge-check
33
title: Module assessment
44
metadata:
55
title: Module assessment
6-
description: Check what you've learned.
6+
description: Check what you learned about debugging in Visual Studio.
77
author: alexwolfmsft
88
ms.author: alexwolf
99
manager: jmartens
@@ -33,36 +33,36 @@ quiz:
3333
choices:
3434
- content: '`Debug.Assert(count != 0, "Count should not be 0.");`'
3535
isCorrect: false
36-
explanation: "Assert tests a condition. If it's true, nothing will happen or else the application will enter break mode. So here, if the count is 0, it will enter break mode."
36+
explanation: "Assert tests a condition. If it's true, nothing happens or else the application enters break mode. So here, if the count is 0, it enters break mode."
3737
- content: '`Debug.Assert(count == 0, "Count should not be 0.");`'
3838
isCorrect: false
39-
explanation: "Assert tests a condition. If it's true, nothing will happen or else the application will enter break mode. So here, if the count is 0, nothing will happen."
39+
explanation: "Assert tests a condition. If it's true, nothing happens or else the application enters break mode. So here, if the count is 0, nothing happens."
4040
- content: '`Debug.WriteIf(count != 0, "Count should not be 0.");`'
4141
isCorrect: false
4242
explanation: "This code prints a message when the count doesn't equal 0."
4343
- content: '`Debug.WriteIf(count == 0, "Count should not be 0.");`'
4444
isCorrect: true
45-
explanation: "This code will only print a debug message when the count is 0."
45+
explanation: "This code only prints a debug message when the count is 0."
4646
- content: "What are the top two values a debugger provides?"
4747
choices:
4848
- content: "Control of your program execution and observation of your program's state"
4949
isCorrect: true
5050
explanation: "The two main values almost every debugger provides are the ability to control program execution and to observe program state."
51-
- content: "Modifying program values and changing your program output"
51+
- content: "Modifying program values and changing your program output."
5252
isCorrect: false
53-
explanation: "Changing your program's output isn't useful because it will only have effect when the application is being debugged."
54-
- content: "Observing your program's state and modifying your program values"
53+
explanation: "Changing your program's output isn't useful because it only has effect when the application is being debugged."
54+
- content: "Observing your program's state and modifying your program values."
5555
isCorrect: false
5656
explanation: "Observing and modifying values are important, but it's also important to be able to control the flow of program execution."
57-
- content: "Editing your program while running and editing program values"
57+
- content: "Editing your program while running and editing program values."
5858
isCorrect: false
5959
explanation: "Editing programs is useful, but observing your program's operational state is another important value that the .NET debugger provides."
6060
- content: "Which Visual Studio debugger window is most useful to observe the current value of a specific variable across different functions?"
6161
choices:
6262
- content: "Use the Locals window because it shows all variables that are currently in scope."
6363
isCorrect: false
6464
explanation: "While the Locals window does display all variables currently in scope, it's not the best way to watch the value of a specific variable."
65-
- content: "Hover over the variable in the code editor to display the value."
65+
- content: "Display the value by hovering over the variable in the code editor."
6666
isCorrect: false
6767
explanation: "While hovering does display the variable's current value, it's a manual process and isn't efficient."
6868
- content: "Use the Watch window to select specific variables or expressions to watch throughout the program's execution."
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
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.
22

33
:::image source="../media/visual-studio-tools.png" alt-text="Screenshot of Visual Studio debugging tools.":::
44

5-
## Fix Bugs Before the Application Launches
5+
## Fix bugs before the application launches
66

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.
88

9-
## What will we be doing?
9+
## What are you going to do?
1010

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 executes using 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.
1212

1313
:::image source="../media/visual-studio-intro.png" alt-text="Screenshot of Visual Studio debugging in action.":::
1414

1515
## What's the main goal?
1616

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.

learn-pr/language/dotnet-debug-visual-studio/includes/2-debugger.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,29 @@ During your journey as a developer, there's always *that* moment when you end up
22

33
> Why isn't my code working?
44
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?
66

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.
108
- 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.
1210
- Take a walk outside.
1311
- Spam a few `Console.WriteLine("here")` messages in your code.
1412

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?
1614

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.
1816

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.
2018

2119
## Why use a debugger?
2220

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.
2422

2523
Every debugger has its own set of features. The two most important ones that come with almost all of them are:
2624

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.
2826
- *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.
2927

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.
3129

3230
Let's discover that in the next unit.

0 commit comments

Comments
 (0)