Skip to content

Commit ba68026

Browse files
authored
Merge pull request #6956 from MicrosoftDocs/master637642334445853191
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents d87350f + 531931a commit ba68026

5 files changed

+83
-25
lines changed

docs/debugger/debug-dotnet-core-in-wsl-2.md

Lines changed: 77 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Debug .NET apps in Linux using WSL 2"
3-
description: Learn to run and debug your .NET apps in WSL 2 without leaving Visual Studio.
4-
ms.date: "07/16/2021"
2+
title: "Debug .NET apps in Linux using WSL"
3+
description: Learn to run and debug your .NET apps in WSL without leaving Visual Studio.
4+
ms.date: "08/06/2021"
55
ms.topic: "conceptual"
66
helpviewer_keywords:
77
- "debugging, linux"
@@ -15,36 +15,58 @@ ms.workload:
1515
- "multiple"
1616
---
1717

18-
# Debug .NET Apps in WSL 2 with Visual Studio
18+
# Debug .NET Apps in WSL with Visual Studio
1919

20-
You can easily run and debug your .NET apps in Linux without leaving Visual Studio using WSL 2. If you are a cross-platform developer, you can use this method as a simple way to test more of your target environments.
20+
You can easily run and debug your .NET apps in Linux without leaving Visual Studio using WSL. If you are a cross-platform developer, you can use this method as a simple way to test more of your target environments.
2121

22-
For a Windows .NET user targeting Linux, WSL 2 lives in a sweet spot between production realism and productivity. In Visual Studio, you can already debug in a remote Linux environment using the [remote debugger](../debugger/remote-debugging-dotnet-core-linux-with-ssh.md), or with containers using the [Container Tools](../containers/overview.md). When production realism is your main concern, you should use one of those options. When an easy and fast inner-loop is more important, WSL 2 is a great option.
22+
For a Windows .NET user targeting Linux, WSL lives in a sweet spot between production realism and productivity. In Visual Studio, you can already debug in a remote Linux environment using the [remote debugger](../debugger/remote-debugging-dotnet-core-linux-with-ssh.md), or with containers using the [Container Tools](../containers/overview.md). When production realism is your main concern, you should use one of those options. When an easy and fast inner-loop is more important, WSL is a great option.
2323

24-
You don’t have to choose just one method! You can have a launch profile for Docker and WSL 2 in the same project and pick whichever is appropriate for a particular run. And once your app is deployed, you can always use the remote debugger to attach to it if there's an issue.
24+
You don’t have to choose just one method! You can have a launch profile for Docker and WSL in the same project and pick whichever is appropriate for a particular run. And once your app is deployed, you can always use the remote debugger to attach to it if there's an issue.
25+
26+
>[!NOTE]
27+
> Starting in Visual Studio 2019 version 16.11 Preview 3, the WSL 2 debug target was renamed to WSL.
2528
2629
## Prerequisites
2730

28-
- Visual Studio 2019 v16.9 Preview 1 or later versions with the .NET Core Debugging with WSL 2 optional component.
31+
- Visual Studio 2019 v16.9 Preview 1 or later versions with the .NET Debugging with WSL optional component.
2932

3033
The optional component is included by default with the .NET Core cross-platform or the ASP.NET and web development workloads. You must install one or both of these workloads.
3134

32-
- Install [WSL 2](/windows/wsl/about).
35+
- Install [WSL](/windows/wsl/about).
3336

3437
- Install the [distribution](https://aka.ms/wslstore) of your choice.
3538

36-
## Start debugging with WSL 2
39+
## Start debugging with WSL
3740

38-
1. After you've installed the required components, open an ASP.NET Core web app or .NET Core console app in Visual Studio You’ll see a new Launch Profile named WSL 2:
41+
1. After you've installed the required components, open an ASP.NET Core web app or .NET Core console app in Visual Studio You’ll see a new Launch Profile named WSL:
3942

40-
![WSL 2 launch profile in the launch profile list](media/linux-wsl2-debugging-select-launch-profile.png)
43+
![WSL launch profile in the launch profile list](media/linux-wsl2-debugging-select-launch-profile.png)
4144

4245
1. Select this profile to add it to your *launchSettings.json*.
4346

4447
Some of the key attributes in the file are shown in the following example.
4548

49+
::: moniker range=">=vs-2022"
50+
51+
>[!NOTE]
52+
> Starting in Visual Studio 2022 Preview 3, the command name in the Launch Profile changed from WSL2 to WSL.
53+
54+
```json
55+
"WSL": {
56+
"commandName": "WSL",
57+
"launchBrowser": true,
58+
"launchUrl": "https://localhost:5001",
59+
"environmentVariables": {
60+
"ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000",
61+
"ASPNETCORE_ENVIRONMENT": "Development"
62+
},
63+
"distributionName": ""
64+
}
65+
```
66+
::: moniker-end
67+
::: moniker range="vs-2019"
4668
```json
47-
"WSL 2": {
69+
"WSL": {
4870
"commandName": "WSL2",
4971
"launchBrowser": true,
5072
"launchUrl": "https://localhost:5001",
@@ -55,10 +77,11 @@ You don’t have to choose just one method! You can have a launch profile for Do
5577
"distributionName": ""
5678
}
5779
```
80+
::: moniker-end
5881

59-
Once you select the new profile, the extension checks that your WSL 2 distribution is configured to run .NET apps, and helps you install any missing dependencies. Once you've installed these dependencies, you are ready to debug in WSL 2.
82+
Once you select the new profile, the extension checks that your WSL distribution is configured to run .NET apps, and helps you install any missing dependencies. Once you've installed these dependencies, you are ready to debug in WSL.
6083

61-
1. Start debugging as normal, and your app will run in your default WSL 2 distribution.
84+
1. Start debugging as normal, and your app will run in your default WSL distribution.
6285

6386
An easy way to verify that you're running in Linux is to check the value of `Environment.OSVersion`.
6487

@@ -69,8 +92,23 @@ You don’t have to choose just one method! You can have a launch profile for Do
6992

7093
By default, the WSL 2 launch profile uses the default distribution as set in *wsl.exe*. If you want your launch profile to target a specific distribution, regardless of that default, you can modify your launch profile. For example, if you're debugging a web app and want to test it on Ubuntu 20.04, your launch profile would look like:
7194

95+
::: moniker range=">=vs-2022"
96+
```json
97+
"WSL": {
98+
"commandName": "WSL",
99+
"launchBrowser": true,
100+
"launchUrl": "https://localhost:5001",
101+
"environmentVariables": {
102+
"ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000",
103+
"ASPNETCORE_ENVIRONMENT": "Development"
104+
},
105+
"distributionName": "Ubuntu-20.04"
106+
}
107+
```
108+
::: moniker-end
109+
::: moniker range="vs-2019"
72110
```json
73-
"WSL 2": {
111+
"WSL": {
74112
"commandName": "WSL2",
75113
"launchBrowser": true,
76114
"launchUrl": "https://localhost:5001",
@@ -81,29 +119,48 @@ By default, the WSL 2 launch profile uses the default distribution as set in *ws
81119
"distributionName": "Ubuntu-20.04"
82120
}
83121
```
122+
::: moniker-end
84123

85124
## Target multiple distributions
86125

87126
Going one step further, if you are working on an application that needs to run in multiple distributions and you want a quick way to test on each of them, you can have multiple launch profiles. For instance, if you need to test your console app on Debian, Ubuntu 18.04, and Ubuntu 20.04, you could use the following launch profiles:
88127

128+
::: moniker range=">=vs-2022"
129+
```json
130+
"WSL : Debian": {
131+
"commandName": "WSL",
132+
"distributionName": "Debian"
133+
},
134+
"WSL : Ubuntu 18.04": {
135+
"commandName": "WSL",
136+
"distributionName": "Ubuntu-18.04"
137+
},
138+
"WSL : Ubuntu 20.04": {
139+
"commandName": "WSL",
140+
"distributionName": "Ubuntu-20.04"
141+
}
142+
```
143+
::: moniker-end
144+
::: moniker range="vs-2019"
89145
```json
90-
"WSL 2 : Debian": {
146+
"WSL : Debian": {
91147
"commandName": "WSL2",
92148
"distributionName": "Debian"
93149
},
94-
"WSL 2 : Ubuntu 18.04": {
150+
"WSL : Ubuntu 18.04": {
95151
"commandName": "WSL2",
96152
"distributionName": "Ubuntu-18.04"
97153
},
98-
"WSL 2 : Ubuntu 20.04": {
154+
"WSL : Ubuntu 20.04": {
99155
"commandName": "WSL2",
100156
"distributionName": "Ubuntu-20.04"
101157
}
102158
```
159+
::: moniker-end
103160

104161
With these launch profiles, you can easily switch back and forth between your target distributions, all without leaving the comfort of Visual Studio.
105162

106-
![Multiple WSL 2 launch profiles in the launch profile list](media/linux-wsl2-debugging-switch-target-distribution.png)
163+
![Multiple WSL launch profiles in the launch profile list](media/linux-wsl2-debugging-switch-target-distribution.png)
107164

108165
## WSL settings in the launch profile
109166

Loading
Loading

docs/ide/whats-new-visual-studio-2019.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Here's a high-level recap of what's new, all-up:
3131
* **[Collaborate](#collaborate)**: Enjoy natural collaboration through a Git-first workflow, real-time editing and debugging, and code reviews right in Visual Studio.
3232
* **[Debug](#debug)**: Highlight and navigate to specific values, optimize memory use, and take automatic snapshots of your application's execution.
3333

34-
For a complete list of everything that's new in this version, see the [release notes](/visualstudio/releases/2019/release-notes/).
34+
For a complete list of everything that's new in this version, see the [release notes](/visualstudio/releases/2019/release-notes/). And, for more info about what's new in the 16.11 release, see the [Visual Studio 2019 v16.11 is available now](https://devblogs.microsoft.com/visualstudio/visual-studio-16-11/) blog post.
3535

3636
## Develop
3737

@@ -218,17 +218,17 @@ We update Visual Studio often with new features that can make your development e
218218

219219
Meanwhile, here's what's currently in the works:
220220

221-
- **Improved Git experience in Visual Studio 2019 (Preview)**
221+
- **Improved Git experience in Visual Studio 2019**
222222

223-
Although the Git version control tool is default experience in Visual Studio 2019 [version 16.8](/visualstudio/releases/2019/release-notes-history/) and later, we continue to add features to enhance the experience in the preview release of Visual Studio 2019, [version 16.11](/visualstudio/releases/2019/release-notes-preview/).
223+
Although the Git version control tool is default experience in Visual Studio 2019 [version 16.8](/visualstudio/releases/2019/release-notes-history/) and later, we continue to add features to enhance the experience in the newest release of Visual Studio 2019, [version 16.11](/visualstudio/releases/2019/release-notes-preview/).
224224

225225
For more information, see the [Version control in Visual Studio](/visualstudio/version-control/) page.
226226

227227
- **Visual Studio 2022 (Preview) is now available**
228228

229229
Our newest version, [Visual Studio 2022 (Preview)](/visualstudio/releases/2022/release-notes-preview/) is faster, more approachable, and more lightweight. And, for the first time ever, Visual Studio is 64-bit.
230230

231-
For a download link and more info, see the **[Visual Studio 2022 vision](https://devblogs.microsoft.com/visualstudio/visual-studio-2022/)** blog post.
231+
For a download link and more info, see the [Visual Studio 2022 vision](https://devblogs.microsoft.com/visualstudio/visual-studio-2022/) blog post, along with the [**Visual Studio 2022 Preview 3 now available**](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-preview-3-now-available/) blog post, too.
232232

233233
## Give us feedback
234234

@@ -240,6 +240,7 @@ Why send feedback to the Visual Studio team? Because we take customer feedback s
240240

241241
## See also
242242

243+
* [What's new in Visual Studio 2022 (Preview)](whats-new-visual-studio-2022.md)
243244
* [What's new in the Visual Studio docs](whats-new-visual-studio-docs.md)
244245
* [Visual Studio 2019 release notes](/visualstudio/releases/2019/release-notes/)
245246
* [Visual Studio 2019 for Mac release notes](/visualstudio/releasenotes/vs2019-mac-relnotes/)

docs/install/workload-and-component-ids.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For more information about how to use these lists, see the [Use command-line par
4545

4646
::: moniker range=">=vs-2019"
4747

48-
**Updated for the [16.10 release](/visualstudio/releases/2019/release-notes/)**
48+
**Updated for the [16.11 release](/visualstudio/releases/2019/release-notes/)**
4949

5050
| **Edition** | **ID** | **Description** |
5151
| ----------- | ------ | --------------- |

0 commit comments

Comments
 (0)