c# – Using WSL1 on visual studio 2022


I’m running LTSC build 1809 with a WSL Debian distro. I have VS2022 installed and not able to debug a project using the WSL profile because it says there is no distro installed. Do I have to install a 2017 or perhaps 2019 VS to run this?

Not able to change WSL versions since my build does not support WSL2. Below is the usage info for my wsl.exe

Usage: wsl.exe [option] ...
Options:
    -d, --distribution <DistributionName>
        Launch the specified distribition.

    -e, --exec <CommandLine>
        Execute the specified Linux command. The remainder of the arguments are
        used as the command line to execute.

    -u, --user <UserName>
        Run as the specified user.

    --help
        Display this usage information.

    --
        Stop parsing arguments and pass the remainder to the Linux process.

LaunchSettings.json has the following:

{
  "profiles": {
    "ConsoleApp1": {
      "commandName": "Project"
    },
    "WSL:Debian": {
      "commandName": "WSL2",
      "distributionName": "Debian"
    }
  }
}

Changing the commandName to “WSL” renders a warning stating that only xxx choices are allowed to include: WSL2, IIS, Docker, Prject, etc…

My Debian install seems to work. I installed GCC and ran some C just fine. I’m trying to debug .NET like this
https://learn.microsoft.com/en-us/visualstudio/debugger/debug-dotnet-core-in-wsl-2?view=vs-2022

Leave a Reply

Your email address will not be published. Required fields are marked *