Skip to content

Commit 8973df8

Browse files
authored
Merge pull request #4708 from MicrosoftDocs/master637157673854234619
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents cb7ecc1 + 11f6b47 commit 8973df8

7 files changed

+73
-0
lines changed

docs/containers/docker-compose-properties.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ Use double quotes around the values, as in the preceding example, and use the ba
104104
|com.microsoft.visualstudio.debuggee.program|The program launched when starting debugging. For .NET Core apps, this setting is typically **dotnet**.|
105105
|com.microsoft.visualstudio.debuggee.workingdirectory|The directory used as the starting directory when starting debugging. This setting is typically */app* for Linux containers, or *C:\app* for Windows containers.|
106106
107+
## Customize the app startup process
108+
109+
You can run a command or custom script before launching your app by using the `entrypoint` setting, and making it dependent on the configuration. For example, if you need to set up a certificate only in **Debug** mode by running `update-ca-certificates`, but not in **Release** mode, you could add the following code only in *docker-compose.vs.debug.yml*:
110+
111+
```yml
112+
services:
113+
webapplication1:
114+
entrypoint: "sh -c 'update-ca-certificates && tail -f /dev/null'"
115+
labels:
116+
...
117+
```
118+
119+
If you omit the *docker-compose.vs.release.yml* or *docker-compose.vs.debug.yml* then Visual Studio generates one based on default settings.
120+
107121
## Next steps
108122

109123
For information on MSBuild properties generally, see [MSBuild Properties](../msbuild/msbuild-properties.md).

docs/debugger/exception-helper.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Inspect an exception - Visual Studio | Microsoft Docs"
3+
ms.date: "1/18/2020"
4+
ms.topic: "conceptual"
5+
dev_langs:
6+
- "CSharp"
7+
- "VB"
8+
- "FSharp"
9+
- "C++"
10+
- "JavaScript"
11+
helpviewer_keywords:
12+
- "exception helper, debugger, exception"
13+
- "debugging [Visual Studio], exception helper, Examine an exception"
14+
author: "mikejo5000"
15+
ms.author: "mikejo"
16+
manager: jillfra
17+
ms.workload:
18+
- "multiple"
19+
---
20+
# Inspect an exception using the Exception Helper
21+
22+
Dealing with exceptions is a common problem, no matter your technology or level of expertise. It can be a frustrating experience figuring out why exceptions are causing problems in your code. When you're debugging an exception in Visual Studio, we want to lessen that frustration by providing you with relevant exception information to help you debug your issue faster.
23+
24+
![Exception Helper](media/debugger-exception-helper-default.png)
25+
26+
## Pause on the exception
27+
When the debugger breaks on an exception, an exception error icon appears to the right of that line of code. A non-modal Exception helper will appear near the exception icon.
28+
29+
![Exception helper next to a line of code](media/debugger-exception-helper-locerror.png)
30+
31+
## Inspect exception info
32+
You can instantly read the exception type and exception message in the Exception Helper, and whether the exception was thrown or unhandled. You can inspect and view properties of the Exception object by clicking the **View Details** link.
33+
34+
## Analyze null references
35+
Starting in Visual Studio 2017, for both .Net and C/C++ code, when you hit a `NullReferenceException` or an `AccessViolation`, you see null analysis information in the Exception Helper. The analysis is displayed as text beneath the exception message. In the illustration below, the information is shown as "**s** was null.".
36+
37+
![Exception helper null analysis](media/debugger-exception-helper-default.png)
38+
39+
40+
> [!NOTE]
41+
> Null reference analysis in managed code requires .NET version 4.6.2. Null analysis is currently not supported for Universal Windows Platform (UWP) and any other .NET Core applications. It is only available while debugging code that does not have any Just-In-Time (JIT) code optimizations.
42+
43+
## Configure exception settings
44+
You can configure the debugger to break when an exception of the current type is thrown from the **Exception Settings** section of the Exception Helper. If the debugger is paused at a thrown exception, then you can use the checkbox to disable breaking on that exception type when thrown in the future. If you don't want to break on this particular exception when thrown in this particular module, tick the checkbox by the module name under **Except when thrown from:** in the **Exception Settings** window.
45+
46+
## Inspect inner exceptions
47+
If the exception has any inner exceptions ([InnerException](https://docs.microsoft.com/dotnet/api/system.exception.innerexception), you can view them in the Exception Helper. If there are multiple exceptions present, you can navigate between them using the left and right arrows shown above the call stack.
48+
49+
![Exception helper with inner exception](media/debugger-exception-helper-innerexception.png)
50+
51+
## Inspect rethrown exceptions
52+
In cases where an exception has been `thrown` the Exception Helper shows the call stack from the first time the exception was thrown. If the exception was thrown multiple times, only the call stack from the original exception is shown.
53+
54+
![Exception helper with rethrown exceptions](media/debugger-exception-helper-innerexception.png)
55+
56+
## Share a debug session with Live Share
57+
From the Exception Helper, you can start a [Live Share](https://docs.microsoft.com/visualstudio/liveshare/) session using the link **Start Live Share session...**. Anyone who joins the Live Share session can see the Exception Helper along with any other debug information.
Loading
Loading
Loading
Loading

docs/debugger/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
items:
5353
- name: Inspect data in debugger windows
5454
href: debugger-windows.md
55+
- name: Inspect exceptions
56+
href: exception-helper.md
5557
- name: Inspect variables
5658
href: autos-and-locals-windows.md
5759
- name: Watch variables

0 commit comments

Comments
 (0)