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
Copy file name to clipboardExpand all lines: docs/get-started/csharp/tutorial-console-part-2.md
+104Lines changed: 104 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -323,6 +323,110 @@ Real-world code involves many projects working together in a solution. Now, let'
323
323
}
324
324
```
325
325
326
+
## Debug: set and hit a breakpoint
327
+
328
+
The Visual Studio debugger is a powerful tool that allows you to run your code step by step, to find the exact point where you made a programming mistake. You then understand what corrections you need to make in your code. Visual Studio allows you to make temporary changes so you can continue running the program.
329
+
330
+
1. In *Program.cs*, click the margin to the left of the following code (or, open the shortcut menu and choose **Breakpoint** > **Insert Breakpoint**, or press **F9**):
The red circle that appears indicates a breakpoint. You can use breakpoints to pause your app and inspect code. You can set a breakpoint on any executable line of code.
337
+
338
+

339
+
340
+
1. Build and run the app.
341
+
342
+
1. In the running app, type some values for the calculation:
343
+
344
+
- For the first number, type **8** and enter it.
345
+
- For the second number, type **0** and enter it.
346
+
- For the operator, let's have some fun; type **d** and enter it.
347
+
348
+
The app suspends where you created the breakpoint, which is indicated by the yellow pointer on the left and the highlighted code. The highlighted code has not yet executed.
349
+
350
+

351
+
352
+
Now, with the app suspended you can inspect your application state.
353
+
354
+
## Debug: view variables
355
+
356
+
1. In the highlighted code, hover over variables such as `cleanNum1` and `op`. You see the current values for these variables (`8` and `d`, respectively), which appear in DataTips.
357
+
358
+

359
+
360
+
When debugging, checking to see whether variables hold the values you expect them to hold is often critical to fixing issues.
361
+
362
+
2. In the lower pane, look at the **Locals** window. (If it's closed, choose **Debug** > **Windows** > **Locals** to open it.)
363
+
364
+
In the Locals window, you see each variable that is currently in scope, along with its value and type.
365
+
366
+

367
+
368
+
3. Look at the **Autos** window.
369
+
370
+
The Autos window is similar to the **Locals** window, but it shows the variables immediately preceding and following the current line of code where your app is paused.
371
+
372
+
Next, you will execute code in the debugger one statement at a time, which is called *stepping*.
373
+
374
+
## Debug: step through code
375
+
376
+
1. Press **F11** (or **Debug** > **Step Into**).
377
+
378
+
Using the Step Into command, the app executes the current statement and advances to the next executable statement (usually the next line of code). The yellow pointer on the left always indicates the current statement.
379
+
380
+

381
+
382
+
You've just stepped into the `DoOperation` method in the `Calculator` class.
383
+
384
+
1. To get a hierarchical look at your program flow, look at the **Call Stack** window. (If it's closed, choose **Debug** > **Windows** > **Call Stack**.)
385
+
386
+

387
+
388
+
This view shows the current `Calculator.DoOperation` method, indicated by the yellow pointer, and the second row shows the function that called it, from the `Main` method in *Program.cs*. The **Call Stack** window shows the order in which methods and functions are getting called. In addition, it provides access to many debugger features, such as **Go to Source Code**, from the shortcut menu.
389
+
390
+
1. Press **F10** (or **Debug** > **Step Over**) several times until the app pauses on the `switch` statement.
391
+
392
+
```csharp
393
+
switch (op)
394
+
{
395
+
```
396
+
397
+
TheStepOvercommandissimilartotheStepIntocommand, exceptthatifthecurrentstatementcallsafunction, thedebuggerrunsthecodeinthecalledfunctionanddoesn't suspend execution until the function returns. Step Over is a faster way to navigate code if you'renotinterestedinaparticularfunction.
Thiscodechecksforadivide-by-zerocase. Iftheappcontinues, itwillthrowageneralexception (anerror), butlet's say you consider this a bug, and want to do something else, like view the actual returned value in the console. One option is to use a debugger feature called Edit-and-continue to make changes to the code and then continue debugging. However, we will show you a different trick to temporarily modify the execution flow.
Copy file name to clipboardExpand all lines: docs/profiling/analyze-memory-usage.md
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,15 @@ To find memory leaks and inefficient memory usage, you can use tools such as the
15
15
16
16
The Memory Usage tool lets you take one or more *snapshots* of the managed and native memory heap. You can collect snapshots of .NET, ASP.NET, C++, or mixed mode (.NET and native) apps. The **Memory Usage** tool can run on an open Visual Studio project, on an installed Microsoft Store app, or attached to a running app or process. You can run the **Memory Usage** tool with or without debugging. For more information, see [Run profiling tools with or without the debugger](../profiling/running-profiling-tools-with-or-without-the-debugger.md). In the debugger, you can turn memory profiling on and off, and see a per-object breakdown of memory usage. You can view memory usage results when execution is paused, for example at a breakpoint.
17
17
18
-
.NET developers may choose between either the [Memory usage](../profiling/memory-usage.md) tool and the [.NET Object Allocation tool](../profiling/dotnet-alloc-tool.md).
19
-
- The **.NET Object Allocation** tool helps you identify allocation patterns and anomalies in your .NET code, and helps identify common issues with garbage collection. This tool runs only as a post-mortem tool. You can run this tool on local or remote machines.
20
-
- The **Memory usage** tool is helpful in identifying memory leaks, which are not typically common in .NET apps. If you need to use debugger features while checking memory, such as stepping through code, the [debugger-integrated Memory usage](../profiling/beginners-guide-to-performance-profiling.md) tool is recommended.
18
+
.NET developers may choose between either the .NET Object Allocation tool or the [Memory usage](../profiling/memory-usage.md) tool.
19
+
20
+
- The [.NET Object Allocation tool](../profiling/dotnet-alloc-tool.md) helps you identify allocation patterns and anomalies in your .NET code, and helps identify common issues with garbage collection. This tool runs only as a post-mortem tool. You can run this tool on local or remote machines.
21
+
- The [Memory Usage tool](../profiling/memory-usage-without-debugging2.md) is helpful in identifying memory leaks, which are not typically common in .NET apps. If you need to use debugger features while checking memory, such as stepping through code, the [debugger-integrated Memory usage](../profiling/memory-usage.md) tool is recommended.
22
+
23
+
C++ developers can use either the debugger-integrated or non-debugger Memory Usage tool.
24
+
25
+
-[Analyze memory usage with the debugger](../profiling/memory-usage.md)
26
+
-[Analyze memory usage without the debugger](../profiling/memory-usage-without-debugging2.md)
21
27
22
28
You can use the profiling tools without the debugger with Windows 7 and later. Windows 8 and later is required to run profiling tools with the debugger (**Diagnostic Tools** window).
23
29
@@ -29,6 +35,5 @@ You can use the profiling tools without the debugger with Windows 7 and later. W
29
35
30
36
## See also
31
37
32
-
-[Analyze memory usage without the debugger](../profiling/memory-usage-without-debugging2.md)
33
38
-[Profiling in Visual Studio](../profiling/index.yml)
34
39
-[First look at profiling tools](../profiling/profiling-feature-tour.md)
Copy file name to clipboardExpand all lines: docs/profiling/memory-usage-without-debugging2.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ ms.workload:
18
18
19
19
The **Memory Usage** tool monitors your app's memory use. You can use the tool to study the real-time memory effects of scenarios you're actively developing in Visual Studio. You can take detailed snapshots of the app's memory states, and compare snapshots to find the root causes of memory issues. The Memory Usage tool is supported on .NET, ASP.NET, C++, or mixed mode (.NET and native) apps.
20
20
21
-
The Memory Usage tool can run [with or without the debugger](../profiling/running-profiling-tools-with-or-without-the-debugger.md). In this article, we show how to use the Memory Usage tool without the debugger in the Visual Studio **Performance Profiler**.
21
+
The Memory Usage tool can run [with or without the debugger](../profiling/running-profiling-tools-with-or-without-the-debugger.md). In this article, we show how to use the Memory Usage tool without the debugger in the Visual Studio **Performance Profiler**, which is recommended for release builds.
@@ -101,7 +101,12 @@ Double-click on a function that you are interested in, and you will see a more d
101
101
102
102
## Analyze memory usage
103
103
104
-
The **Diagnostic Tools** window also allows you to evaluate memory usage in your app using the **Memory Usage** tool. For example, you can look at the number and size of objects on the heap. You can use the [debugger-integrated Memory Usage tool](../profiling/memory-usage.md) or the [post-mortem Memory Usage tool](../profiling/memory-usage-without-debugging2.md) in the Performance Profiler. Another memory analysis tool, the [.NET Object Allocation tool](../profiling/dotnet-alloc-tool.md), helps you identify allocation patterns and anomalies in your .NET code.
104
+
The **Diagnostic Tools** window also allows you to evaluate memory usage in your app using the **Memory Usage** tool. For example, you can look at the number and size of objects on the heap. You can use the [debugger-integrated Memory Usage tool](../profiling/memory-usage.md) or the [post-mortem Memory Usage tool](../profiling/memory-usage-without-debugging2.md) in the Performance Profiler.
105
+
106
+
.NET developers may choose between either the [.NET Object Allocation tool](../profiling/dotnet-alloc-tool.md) or the [Memory usage](../profiling/memory-usage.md) tool.
107
+
108
+
- The **.NET Object Allocation** tool helps you identify allocation patterns and anomalies in your .NET code, and helps identify common issues with garbage collection. This tool runs only as a post-mortem tool. You can run this tool on local or remote machines.
109
+
- The **Memory usage** tool is helpful in identifying memory leaks, which are not typically common in .NET apps. If you need to use debugger features while checking memory, such as stepping through code, the [debugger-integrated Memory usage](../profiling/beginners-guide-to-performance-profiling.md) tool is recommended.
105
110
106
111
To analyze memory usage with the **Memory Usage** tool, you need to take at least one memory snapshot. Often, the best way to analyze memory is to take two snapshots; the first right before a suspected memory issue, and the second snapshot right after a suspected memory issue occurs. Then you can view a diff of the two snapshots and see exactly what changed. The following illustration shows taking a snapshot with the debugger-integrated tool.
107
112
@@ -163,7 +168,7 @@ In your UWP apps, you can enable **UI Analysis** in the **Diagnostic Tools** win
163
168
164
169
In Direct3D apps (Direct3D components must be in C++), you can examine activity on the GPU and analyze performance issues. For more information, see [GPU Usage](./gpu-usage.md). To use the tool, choose **GPU Usage** in the Performance Profiler, and then choose **Start**. In your app, go through the scenario that you're interested in profiling, and then choose **Stop collection** to generate a report.
165
170
166
-
When you select a time period in the graphs and choose **view details**, a detailed view appears in the lower pane. In the detailed view, you can examine how much activity is happening on each CPU and GPU. Select events in the lowest pane to get popups in the timeline. For example, select the **Present** event to view **Present** call popups. (The light gray vertical Vsync lines can be used as a reference to understand whether certain **Present** calls missed Vsync. There must be one **Present** call between every two Vsyncs in order for the app to steadily hit 60 FPS.)
171
+
When you select a time period in the graphs and choose **view details**, a detailed view appears in the lower pane. In the detailed view, you can examine how much activity is happening on each CPU and GPU. Select events in the lowest pane to get popups in the timeline. For example, select the **Present** event to view **Present** call popups. (The light gray vertical VSync lines can be used as a reference to understand whether certain **Present** calls missed VSync. There must be one **Present** call between every two VSyncs in order for the app to steadily hit 60 FPS.)
Copy file name to clipboardExpand all lines: docs/profiling/running-profiling-tools-with-or-without-the-debugger.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ To help decide which tools and results to use, consider the following:
25
25
- External performance problems, like file I/O or network responsiveness issues, won't look much different in the debugger or non-debugger tools.
26
26
- The debugger itself changes performance times, as it does necessary debugger operations like intercepting exception and module load events.
27
27
- Release build performance numbers in the Performance Profiler are the most precise and accurate. Debugger-integrated tool results are most useful to compare with other debugging-related measurements, or to use debugger features.
28
+
- Some tools, such as the .NET Object Allocation tool, are only available for non-debugger scenarios.
28
29
- Debug vs. release build
29
30
- For problems caused by CPU-intensive calls, there might be considerable performance differences between release and debug builds. Check to see whether the issue exists in release builds.
30
31
- If the problem occurs only during debug builds, you probably don't need to run the non-debugger tools. For release build problems, decide whether features provided by the debugger-integrated tools will help to pinpoint the problem.
Copy file name to clipboardExpand all lines: subscriptions/vscloud-overview.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
title: How to purchase Visual Studio cloud subscriptions
3
3
author: evanwindom
4
4
ms.author: v-evwin
5
-
manager: lank
5
+
manager: cabuschl
6
6
ms.assetid: af1f7888-6942-4515-9475-0928ecf49dab
7
-
ms.date: 10/21/2020
7
+
ms.date: 10/28/2020
8
8
ms.topic: overview
9
9
description: Rent Visual Studio Professional or Visual Studio Enterprise on a month-to-month or annual basis, with no long-term contract.
10
10
---
@@ -100,7 +100,7 @@ A: No. Your subscriptions will remain in place and you will be able to manage
100
100
A: Annual subscriptions that are purchased during a given month are charged immediately for a full year and are valid for a full year. For that reason, you can modify the number of licenses only in the current month of purchase (they will be valid for one year and charged for one year). Outside of the month of purchase, it is no longer possible to increase the number of subscriptions.
101
101
102
102
#### Q: What if I want to decrease the number of subscriptions for my customers?
103
-
A: Your administrator can still decrease the number of subscriptions by visiting https://manage.visualstudio.com and following the instructions in this article to decrease subscription counts. The system will *not* generate a pro-rated credit. For a refund you will need to contact the Azure billing team.
103
+
A: Your admin can still decrease the number of subscriptions by visiting https://manage.visualstudio.com and following the instructions in this article to decrease subscription counts. The system will *not* generate a pro-rated credit. For a refund you will need to contact the Azure billing team.
104
104
105
105
#### Q: If I cancel my subscription, will I be able to buy another Annual Cloud subscription later?
106
106
A: Although you will not be able to buy another Cloud Annual subscription, there are many options to purchase Visual Studio Subscriptions. Learn more at [https://visualstudio.microsoft.com/vs/pricing/](https://visualstudio.microsoft.com/vs/pricing/).
@@ -113,10 +113,10 @@ A: Your customers will not be able to purchase new Visual Studio Cloud Annual s
113
113
A: Existing customers will not be impacted. New customers will need to decide whether they want to purchase Visual Studio Monthly subscriptions or go to another channel such as volume licensing to purchase Visual Studio Subscriptions.
114
114
115
115
#### Q: What if I want to increase the number of subscriptions for my customers?
116
-
A: Annual subscriptions purchased during a given month are charged immediately for a full year and are valid for a full year. For that reason, your administrator can only modify the number of licenses in the current month of purchase (they will be valid for 1 year and charged for 1 year). Outside of the month of purchase it is no longer possible to increase the number of subscriptions.
116
+
A: Annual subscriptions purchased during a given month are charged immediately for a full year and are valid for a full year. For that reason, your admin can only modify the number of licenses in the current month of purchase (they will be valid for 1 year and charged for 1 year). Outside of the month of purchase it is no longer possible to increase the number of subscriptions.
117
117
118
118
#### Q: What if I want to decrease the number of subscriptions for my customers?
119
-
A: Your administrator can still decrease the number of subscriptions by visiting [https://manage.visualstudio.com](https://manage.visualstudio.com) and following the instructions in this article to decrease subscription counts. The system will **not** generate a pro-rated credit. For a refund you will need to contact the Azure billing team.
119
+
A: Your admin can still decrease the number of subscriptions by visiting [https://manage.visualstudio.com](https://manage.visualstudio.com) and following the instructions in this article to decrease subscription counts. The system will **not** generate a pro-rated credit. For a refund you will need to contact the Azure billing team.
120
120
121
121
#### Q: If my customers cancel their subscriptions, will they be able to buy more Annual Cloud subscriptions later?
122
122
A: Although they will not be able to buy another Cloud Annual subscription, there are many options to purchase Visual Studio Subscriptions. Learn more at [https://visualstudio.microsoft.com/vs/pricing/](https://visualstudio.microsoft.com/vs/pricing/).
0 commit comments