Debugging rust code in vscode with WSL

I cannot debug my rust code which is in WSL with VScode installed on my windows. I get these below errors during "debug".

Error: there is no registered task type 'codelldb.cargo'. Did you miss installing an extension that provides a corresponding task provider?
Error: there is no registered task type 'codelldb.cargo'. Did you miss installing an extension that provides a corresponding task provider?

Strangely I can "run" my code using vscode, I get expected output and don't see any error there. It is only during debug I see these errors

BTW I have installed these extension for WSL in vscode

codeLLDB
rust-analyzer

version info

WSL  version 1
vscode 1.72.2

What I'm missing here

Can't talk for your specific problem, but I strongly advise you to switch to WSL 2. It's faster, more robust, and supports more features (like direct Docker integration or systemd among many other things) :slight_smile:

I got exactly the same issue on a freshly installed system.

This issue is due to WSL version. issue got fixed after upgrading WSL from v1 to v2

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.