Visual Studio not showing WSL2 launch profile
Asked Answered
N

2

5

I have just updated my Visual Studio community 2019 to version 16.9.1. But I am not able to see the WSL2 profile as mentioned in this document.

Also, my machine has all the Prerequisites.

I have tried with the existing and new console app, web app with target framework .net core 3.1 and .NET 5, but not showing the option.

Also, I have tried adding the below settings to the launchSettings.json file, but when running with this change, it shows the error

The Project does not know how to run the Profile WSL 2.

"WSL 2": {
    "commandName": "WSL2",
    "launchBrowser": true,
    "launchUrl": "https://localhost:5001",
    "environmentVariables": {
        "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000",
        "ASPNETCORE_ENVIRONMENT": "Development"
    },
    "distributionName": ""
}
Nonfulfillment answered 12/3, 2021 at 11:29 Comment(2)
please check if you install this component [1]: i.sstatic.net/a3vrm.png. Because we need to install it manually.Electromagnet
@JackJJun-MSFT I tried with your suggestion, it's working as expected. you can add this as the answer. Also when I run the console app using the WSL2 profile, I am able to debug. But I cannot see the console in my windows system, so it means it is running on WSL. How can I see the app console output?Nonfulfillment
E
14

please check if you install the following component . Because we need to install it manually.

enter image description here

Electromagnet answered 17/3, 2021 at 1:29 Comment(1)
I have it installed and it doesn't show upUnlash
C
0

As of the version of Visual Studio I have installed, Microsoft Visual Studio 2022 (64-bit) - Current, Version 17.11.4, the WSL 2 option does not exist. Trying to add the feature by opening Tools -> Get Tools and Features ... and selecting Individual components, and searching for wsl, I get the following:
Visual Studio Tools and Features - Individual components

Had to enable "Linux and embedded development with C++" in the Workloads tab to get the WSL Launch Target to appear.
Visual Studio Tools and Features - Workloads

Crockery answered 23/9, 2024 at 12:40 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.