I've been using visual studio 2019 to compile my CMake-based code on WSL for a while. Everything was ok, but After converting my WSL to version 2, Visual Studio complains that it can't open windows subsystem shell. Logs say:
14:33:31.4546992 [Info, Thread 53] liblinux.Local.Shell.WindowsSubsystemShell: Connecting to WSL at "C:\Users\s4eed\AppData\Local\Microsoft\WindowsApps\ubuntu2004.exe"
14:33:31.4716997 [Info, Thread 53] liblinux.Local.Shell.WindowsSubsystemShell: VerifyEcho sentinel:087a80d8-44fa-49fe-afac-5a65d4a1443b id:84cc4c3f-2caf-4a49-90f6-ad9026c022de
14:33:31.4716997 [Info, Thread 53] liblinux.Local.Shell.WindowsSubsystemShell: Writing "echo 087a80d8-44fa-49fe-afac-5a65d4a1443b" to WSL shell
14:33:31.4716997 [Info, Thread 110] liblinux.Local.Shell.WindowsSubsystemShell: Read async: 84cc4c3f-2caf-4a49-90f6-ad9026c022de
14:33:31.5764967 [Info, Thread 104] liblinux.Local.Shell.WindowsSubsystemShell: 84cc4c3f-2caf-4a49-90f6-ad9026c022de is exiting
14:33:31.5775017 [Info, Thread 120] liblinux.Local.Shell.WindowsSubsystemShell: Disconnecting from WSL at "C:\Users\s4eed\AppData\Local\Microsoft\WindowsApps\ubuntu2004.exe"
14:33:31.5775017 [Info, Thread 53] liblinux.Local.Shell.WindowsSubsystemShell: VerifyEcho failed 84cc4c3f-2caf-4a49-90f6-ad9026c022de
14:33:31.5775017 [Error, Thread 53] liblinux.Local.Shell.WindowsSubsystemShell: Exception starting WSL process
14:33:31.5775017 [Error, Thread 53] liblinux.Local.Shell.WindowsSubsystemShell: liblinux.Local.Shell.WindowsSubsystemShellException: Echo command failing
at liblinux.Local.Shell.WindowsSubsystemShell.VerifyEcho(TimeSpan timeout)
at liblinux.Local.Shell.WindowsSubsystemShell.StartWSLProcess(TimeSpan timeout)