Debugging in Visual Studio Code is a nightmare

Hello,
Since some months ago I’ve started to have a lot of issues when debugging with visual studio code… 1-2 years ago vscode was a delight to use alongside unity… but now it’s becoming worse and worse with each update… I was hoping an update would solve all these problems, but nothing happens so I started to wonder if I’m doing something wrong… Every time I hit debug I have to cross my fingers and pray to god for the debugger to work properly… it works maybe 4 of 10 times and there is a 3/10 chance that it causes the unity editor to completely freeze. I’ve tried updating the debugger extension to beta 3.0.2, but nothing changes… I’ve also tried downgrading visual studio code and even reinstalling the whole package… but nothing.

Currently, I’m using:

Visual Studio Code 1.48.2
Debugger for Unity 2.7.5
C# Extension 1.23.2
Unity 2019.4.0
Visual Studio Code Editor 1.2.1

Does someone have an idea of what might cause visual studio code to debug so badly?

UPDATE: I’ve read in another thread that some people were able to make this tool work fine by downgrading to 1.42.1… I’ve uninstalled my current version and installed that one… and I have the same problems… the editor freezing, the debugger stopping or not hitting breakpoints. etc

Rider has been pretty stable with the debugger for a long time. It’s worth the money.

Any news about that issue ? I cross my fingers too, each time !

The Debugger for Unity extension has been deprecated. Luckily, there’s a new way to debug with VSCode. You need the Unity extension in VSCode (which also installs the C# and C# Dev Kit extensions). Additionally, you need to use the Visual Studio Editor package (2.2.22) in Unity (not the Visual Studio Code Editor package). With this setup, debugging works very well! :slight_smile:

2 Likes