Skip to content

Commit 9e220b8

Browse files
authored
Merge pull request #643 from MicrosoftDocs/master
merge to live
2 parents 114fc39 + cd8d851 commit 9e220b8

29 files changed

+296
-39
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.vs/
12
log/
23
obj/
34
_site/

docs/debugger/debug-azure-apps.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "Debug Azure apps | Microsoft Docs"
3+
ms.date: "08/08/2017"
4+
ms.reviewer: ""
5+
ms.suite: ""
6+
ms.technology:
7+
- "vs-ide-debug"
8+
ms.tgt_pltfrm: ""
9+
ms.topic: "article"
10+
helpviewer_keywords:
11+
- "debugger"
12+
ms.assetid: 3d434de3-ee5f-419d-9a94-ac4ac02d635b
13+
caps.latest.revision: 1
14+
author: "mikejo5000"
15+
ms.author: "mikejo"
16+
manager: "ghogen"
17+
translation.priority.ht:
18+
- "de-de"
19+
- "es-es"
20+
- "fr-fr"
21+
- "it-it"
22+
- "ja-jp"
23+
- "ko-kr"
24+
- "ru-ru"
25+
- "zh-cn"
26+
- "zh-tw"
27+
translation.priority.mt:
28+
- "cs-cz"
29+
- "pl-pl"
30+
- "pt-br"
31+
- "tr-tr"
32+
---
33+
# Debug Azure apps
34+
35+
You can use Visual Studio to debug Azure apps in different scenarios:
36+
37+
- To debug a production app hosted in Azure App Service, see [Debug a live Azure app](../debugger/debug-live-azure-applications.md).
38+
39+
- To debug a production app using Application Insights and hosted in Azure App Service or Service Fabric, see [Debug snapshots on exceptions in .NET apps](/azure/application-insights/app-insights-snapshot-debugger).
40+
41+
- To remote debug ASP.NET on IIS (Azure App Service or an Azure VM), see [Remote Debugging ASP.NET on Azure](remote-debugging-azure.md).
42+
43+
- To remote debug ASP.NET on Azure Service Fabric, see [Debug a remote Service Fabric application](/azure/service-fabric/service-fabric-debugging-your-application#debug-a-remote-service-fabric-application)
44+
45+
## See Also
46+
[Debugging in Visual Studio](../debugger/index.md)
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: "Debug live Azure Applications (ASP.NET) | Microsoft Docs"
3+
ms.date: "07/26/2017"
4+
ms.reviewer: ""
5+
ms.suite: ""
6+
ms.technology:
7+
- "vs-ide-debug"
8+
ms.tgt_pltfrm: ""
9+
ms.topic: "article"
10+
helpviewer_keywords:
11+
- "debugger"
12+
ms.assetid: adb22512-4d4d-40e5-9564-1af421b7087e
13+
caps.latest.revision: 1
14+
author: "mikejo5000"
15+
ms.author: "mikejo"
16+
manager: "ghogen"
17+
translation.priority.ht:
18+
- "de-de"
19+
- "es-es"
20+
- "fr-fr"
21+
- "it-it"
22+
- "ja-jp"
23+
- "ko-kr"
24+
- "ru-ru"
25+
- "zh-cn"
26+
- "zh-tw"
27+
translation.priority.mt:
28+
- "cs-cz"
29+
- "pl-pl"
30+
- "pt-br"
31+
- "tr-tr"
32+
---
33+
# Debug live ASP.NET apps running in Azure App Service
34+
35+
The Snapshot Debugger takes a snapshot of your in-production apps when code that you are interested in executes. To instruct the debugger to take a snapshot, you set snappoints and logpoints in your code. The debugger lets you see exactly what went wrong, without impacting traffic of your production application. The Snapshot Debugger can help you dramatically reduce the time it takes to resolve issues that occur in production environments.
36+
37+
Snapshot collection is available for the following web apps running in Azure App Service:
38+
39+
- ASP.NET applications running on .NET Framework 4.6.1 or later.
40+
- ASP.NET Core applications running on .NET Core 2.0 or later on Windows.
41+
42+
Additionally, the Snapshot Debugger is only available for **Visual Studio Enterprise**.
43+
44+
> [!NOTE]
45+
> With some additional configuration, Application Insights can automatically capture snapshots when your app hits an exception. For more information, see [Debug snapshots on exceptions in .NET apps](/azure/application-insights/app-insights-snapshot-debugger). Application Insights supports Service Fabric apps in addition to Azure App Service.
46+
47+
## Start the Snapshot Debugger
48+
49+
1. Install the [Visual Studio Enterprise 15.4 Preview](http://www.microsoft.com) or later.
50+
51+
2. Install the [Snapshot Debugger extension](https://aka.ms/snappoint) for Visual Studio. This extension will enable you to set snappoints and logpoints against apps running in Azure App Services.
52+
53+
3. Open the project you would like to snapshot debug.
54+
55+
> [!NOTE]
56+
> In order to snapshot debug, you need to open the **same version of source code** that is published to your Azure Azure App Service.
57+
58+
4. In the Cloud Explorer, right click the Azure App Service your project is deployed to and select **Attach Snapshot Debugger** to start the Snapshot Debugger.
59+
60+
![Launch the snapshot debugger](../debugger/media/snapshot-launch.png "Launch the snapshot debugger")
61+
62+
> [!NOTE]
63+
> The first time you select **Attach Snapshot Debugger**, you will be prompted to install the Snapshot Debugger on your Azure App Service. This installation requires a restart of your Azure App Service.
64+
65+
Visual Studio is now in snapshot debugging mode.
66+
67+
![Snapshot debugging mode](../debugger/media/snapshot-message.png "Snapshot debugging mode")
68+
69+
The **Modules** window shows you when all the modules have loaded for the Azure App Service (choose **Debug / Windows / Modules** to open this window).
70+
71+
![Check the Modules window](../debugger/media/snapshot-modules.png "Check the Modules window")
72+
73+
## Set a snappoint
74+
75+
1. In the code editor, click the left gutter next to a line of code you are interested in to set a snappoint (make sure it is code that you know will execute).
76+
77+
![Set a snappoint](../debugger/media/snapshot-set-snappoint.png "Set a snappoint")
78+
79+
> [!NOTE]
80+
> Unlike breakpoints, snappoints do not halt the application when hit. Typically, capturing a snapshot at a snappoint takes 10-20 milliseconds.
81+
82+
2. Click **Start Collection** to turn on the snappoint.
83+
84+
![Turn on the snappoint](../debugger/media/snapshot-start-collection.png "Turn on the snappoint")
85+
86+
> [!TIP]
87+
> You cannot step when viewing a snapshot, but you can place multiple snappoints in your code to follow execution at different lines of code. If you have multiple snappoints in your code, the Snapshot Debugger ensures that the corresponding snapshots are from the same end user session, even if there are multiple users hitting your app.
88+
89+
## Take a snapshot
90+
91+
When a snappoint is turned on, it will capture a snapshot whenever the line of code where the snappoint is placed is executed. This execution can be caused by a real request on your server. To force your snappoint to hit, you can also go to the browser view of your web site and take any actions required that will cause your snappoint to be hit.
92+
93+
## Inspect snapshot data
94+
95+
1. When the snappoint is hit, a snapshot appears in the Diagnostic Tools window (choose **Debug / Windows / Show Diagnostic Tools** to open this window).
96+
97+
![Open a snappoint](../debugger/media/snapshot-diagsession-window.png "Open a snappoint")
98+
99+
2. Double-click the snappoint to open the snapshot in the code editor.
100+
101+
![Inspect snapshot data](../debugger/media/snapshot-inspect-data.png "Inspect snapshot data")
102+
103+
From this view, you can hover over variables to view DataTips, use the **Locals**, **Watches**, and **Call Stack** windows, and also evaluate expressions.
104+
105+
> [!NOTE]
106+
> The website itself is still live and end users are not impacted.
107+
108+
Only one snapshot is captured per snappoint by default: after a snapshot is captured the snappoint turns off. If you want to capture another snapshot at the snappoint, you can turn the snappoint back on by clicking **Update Collection**.
109+
110+
You can also add more snappoints to your app and turn them on with the **Update Collection** button.
111+
112+
## Set a conditional snappoint
113+
114+
If it is difficult to recreate a particular state in your app, consider whether the use of a conditional snappoint can help. You can use conditional snappoints to avoid taking a snapshot until the app enters a desired state (such as a state in which a variable has a particular value you're interested in). You can set conditions using expressions, filters, or hit counts.
115+
116+
#### To create a conditional snappoint
117+
118+
1. Right-click a snappoint icon (the hollow ball) and choose **Settings**.
119+
120+
![tbd](../debugger/media/snapshot-snappoint-settings.png "t b d")
121+
122+
2. In the snappoint settings window, type an expression.
123+
124+
![tbd](../debugger/media/snapshot-snappoint-conditions.png "t b d")
125+
126+
In the preceding illustration, the snapshot will only be taken for the snappoint when `visitor.FirstName == "Dan"`.
127+
128+
## Set a logpoint
129+
130+
In addition to taking a snapshot when a snappoint is hit, you can also configure a snappoint to log a message (that is, create a logpoint). You can set logpoints without having to redploy your app. Logpoints are virtually executed and cause no impact or side effects to your running application.
131+
132+
#### To create a logpoint
133+
134+
1. Right-click a snappoint icon (the blue hexagon) and choose **Settings**.
135+
136+
2. In the snappoint settings window, select **Actions**.
137+
138+
![Create a logpoint](../debugger/media/snapshot-logpoint.png "Create a logpoint")
139+
140+
3. In the Message field, you can enter the new log message you want to log. You can also evaluate variables in your log message by placing them inside curly braces.
141+
142+
If you choose **Send to Output Window**, when the logpoint is hit, the message will appear in the Diagnostic Tools window.
143+
144+
![Logpoint data in the .diagsession window](../debugger/media/snapshot-logpoint-output.png "Logpoint data in the .diagsession window")
145+
146+
If you choose **Send to application log**, when the logpoint is hit, the message will appear anywhere that you can see messages from `System.Diagnostics.Trace` (or `ILogger` in .NET Core), such as [App Insights](/azure/application-insights/app-insights-asp-net-trace-logs).
147+
148+
## Frequently Asked Questions
149+
150+
#### What is the performance cost of taking a snapshot?
151+
When the Snapshot Debugger captures a snapshot of your app, it is forking the app's process and suspending the forked copy. When you debug a snapshot, you are debugging against the forked copy of the process. This process takes only 10-20 milliseconds but does not copy the full heap of the app; instead, it copies only the page table and sets pages to copy on write. If some of your app's objects on the heap change, their respective pages are then copied. Each snapshot therefore has a very small in-memory cost (on the order of hundreds of kilobytes for most apps).
152+
153+
#### What happens if I have a scaled-out Azure App Service (multiple instances of my app)?
154+
When you have multiple instances of your app, snappoints get applied to every single instance. Only the first snappoint to hit with the condtions specified will create a snapshot. If you have multiple snappoints, subsequent snapshots will come from the same instance that created the first snapshot. Logpoints sent to the output window will only show messages from one instance, while logpoints sent to application logs will send messages from every instance.
155+
156+
#### How does the Snapshot Debugger load symbols?
157+
The Snapshot Debugger requires you to have the correct symbols corresponding to your application either locally or deployed to your Azure App Service (embedded PDBs are currently not supported). The Snapshot Debugger will automatically download symbols from your Azure App Service. As of Visual Studio 2017 (version 15.2), deploying to Azure App Service will also deploy your app's symbols.
158+
159+
#### Does the Snapshot Debugger work against release builds of my application?
160+
Yes - the Snapshot Debugger is intended to work against release builds. When a snappoint is placed in a function, we temporarily recompile that function back to a debug version and making it debuggable. When you stop the Snapshot Debugger, the functions are returned to their release build.
161+
162+
#### Can logpoints cause side effects in my production application?
163+
No - any log messages you add to your app are evaluated virtually. They cannot cause any side effects in your application. However, some native properties may not be accessible with logpoints.
164+
165+
#### Does the Snapshot Debugger work if my server is under load?
166+
Yes - Snapshot Debugging can work for servers under load. The Snapshot Debugger will throttle and not capture snapshots in situations where there is a low amount of free memory on your server.
167+
168+
## See Also
169+
[Debug Azure apps](../debugger/debug-azure-apps.md)
6.94 KB
Loading
Loading
81 KB
Loading
23.7 KB
Loading
Loading
Loading
5.54 KB
Loading
67.8 KB
Loading
4.25 KB
Loading
63.1 KB
Loading
8.08 KB
Loading
Loading
Loading
Loading

docs/extensibility/how-to-use-wizards-with-project-templates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Visual Studio provides the <xref:Microsoft.VisualStudio.TemplateWizard.IWizard>
7676

7777
- **IncludeDebugSymbolsInLocalVSIXDeployment**
7878

79-
3. Add the assembly as an asset to the VSIX project. Open the source.extension.vsixmanifest file and select the **Assets** tab. In the **Add New Asset** window, for **Type** select **Microsoft.VisualStudio.Assembly**, for **Source** select **A project in current solution**, and for **Project** select **MyTemplateWizard**.
79+
3. Add the assembly as an asset to the VSIX project. Open the source.extension.vsixmanifest file and select the **Assets** tab. In the **Add New Asset** window, for **Type** select **Microsoft.VisualStudio.Assembly**, for **Source** select **A project in current solution**, and for **Project** select **MyProjectWizard**.
8080

8181
4. Add the following references to the VSIX project. (In the **Solution Explorer**, under the VSIX project node select **References**, right-click, and select **Add Reference**.) In the **Add Reference** dialog, in the **Framework** tab, find the **System.Windows Forms** assembly and select it. Now select the **Extensions** tab. find the **EnvDTE** assembly and select it. Also find the **Microsoft.VisualStudio.TemplateWizardInterface** assembly and select it. Click **OK**.
8282

@@ -167,7 +167,7 @@ Visual Studio provides the <xref:Microsoft.VisualStudio.TemplateWizard.IWizard>
167167

168168
- An <xref:System.Object> array that contains a set of parameters passed to the wizard by Visual Studio.
169169

170-
This example adds a parameter value from the user input form to the <xref:System.Collections.Generic.Dictionary%602> parameter. Every instance of the `$custommessage$` parameter in the project will be replaced with the text entered by the user. You must add the following assemblies to your project:
170+
This example adds a parameter value from the user input form to the <xref:System.Collections.Generic.Dictionary%602> parameter. Every instance of the `$custommessage$` parameter in the project will be replaced with the text entered by the user. You must add the following assemblies to your project: **System** and **System.Drawing**.
171171

172172
7. Now create the **UserInputForm**. In the **WizardImplementation.cs** file, add the following code after the end of the **WizardImplementation** class.
173173

0 commit comments

Comments
 (0)