vscode icon indicating copy to clipboard operation
vscode copied to clipboard

WSL/C# Debugging extremely slow after WSL update to 2.5.7

Open PashaPash opened this issue 6 months ago • 1 comments

Does this issue occur when all extensions are disabled?: N/A

  • VS Code Version: Version: 1.101.0 (user setup)
  • OS Version: Windows_NT x64 10.0.22621
  • WSL version: 2.5.7.0
  • Kernel version: 6.6.87.1-1

Steps to Reproduce:

  1. Install WSL with the default Ubuntu 24.04.2 LTS distro from the Microsoft Store.
  2. Install the following VS Code extensions: WSL, C# Dev Kit.
  3. Clone or check out any midsize C# project with unit tests.
  4. Connect VS Code to the WSL distro and open the project folder.
  5. Set a breakpoint in a test and start debugging.
  6. When the breakpoint is hit, try stepping through the code line by line.
  7. Each step exhibits noticeable lag.
  8. Local variables take time to refresh between steps.

Performance degradation is more noticeable in larger codebases and clearly depends on the number of classes or assemblies referenced by the code under debug. In a midsize project, some debugging operations - such as Step or Set Next Statement - now take around 5-6 seconds to complete in my case.

https://github.com/user-attachments/assets/388f79d2-a652-4ae3-8554-5b406ebcc5cf

The issue appears to be caused by the recent WSL update from version 2.4.13 to 2.5.7. Currently, there is no way to roll back to the previous version. I was able to reproduce the issue on another PC by upgrading WSL only, while keeping the VS Code and plugin versions the same. Please advise on a possible fix or workaround.

PashaPash avatar Jun 12 '25 20:06 PashaPash

Workaround: download and install WSL 2.4.13 from https://github.com/microsoft/WSL/releases, no uninstall needed.

PashaPash avatar Jun 12 '25 22:06 PashaPash

Workaround: download and install WSL 2.4.13 from https://github.com/microsoft/WSL/releases, no uninstall needed.

Thank you so much, this has been bothering me for weeks. And this is not only when debugging tests. I have had issues on both 2.5.x and 2.6

sgqkmd avatar Jun 20 '25 08:06 sgqkmd

Marking this as a duplicate of https://github.com/microsoft/WSL/issues/13215 opened on WSL.

TylerLeonhardt avatar Jul 10 '25 08:07 TylerLeonhardt