A new version of the Unity Debugger Extension for Visual Studio Code is being released here for early testing and feedback. The debugger extension has been upgraded to the latest debugger libraries to provide a better debugging experience and try to address some of the issues found by users.
The main issue this new release addresses is support for the new .NET 4.x Mono runtime in Unity.
If you need to download an earlier release please visit the GitHub page and download them from the release page. This link will be kept up-to date with the latest version at all times.
Installation
Warning: Installing this version will override your existing Unity Debugger extension.
The provided .vsix file can be manually installed from inside VS Code by following these instructions:
Open your workspace, in the extension tab in the left menu.
Here you can open settings on the three dots in the bar with the name Extensions.
Click install from VSIX
How to uninstall
Go to the extension tab.
Click on the cogwheel next to the Debugger for Unity 2.0.0 under installed.
I will try it out later today and report if there are any problems, just wanted to say thank you, epic!
Also, do you plan to add support for log points which vscode introduced in march update? I may try my hand with it if you donât plan to work on it. I want to help with vscodeâs handling of unity projects, I am currently working on PR to omnisharp which should fix handling of new/renamed files
Log points can be really smart if you are debugging production code and want to introduce non-breaking info. However I am not sure if the mono debugger supports this feature?
Hi,
thank you for update.
When i try to put a breakpoint i get the error:
error while processing request âsetBreakpointsâ (exception: An item with the same key has already been added. Key: [0, Mono.Debugging.Client.Breakpoint])
I tried it, looks like there is an exception CodeFighter mentioned every time I try to add more than one breakpoint. Only other thing I noticed is that hovering variables feels much more responsive than last time I remembered. Looking forward to next update
Can you give me some specifications of the setup you are using? I donât seem to be able to reproduce the problem you are having?
Versions of VS code, unity, OS and so on?
If you have a small Steps to Reproduce that could also be very helpful
It looks like i found the reason.
I had list of old breakpoints from the previous version.
That is why error said about key already added.
I have deleted all breapoints and now it works fine.
Thank you for keeping of working on VS code plugin we really appreciate it
The problem has been replicated in both this extension and in Visual Studio for Mac. Rider works, however, they are having a significantly different backend to support these issues.
There has been a issue filed to mono to get this issue resolved as fast as possible.
New 2.1.0 release of the Debugger Extension is out. This version should make it possible to see strings longer than 100 characters. The way to do that is by evaluating the string in the debugger console or to add it to a watch field. This is a work around, due to how debugger extensions are done in VS Code, maybe a cleaner fix can be found going forward. However this makes sure that it is possible to see the string variable. As an after thought it is also possible to move the ellipsing of the string to 1000 characters if that would be of any use? Then the truncation would happen on much longer strings, but still not pollute the variables view. What do you think?
New 2.2.0 release of the Debugger Extension is out. This version is the first step to make it possible to modify variables at runtime. By right clicking on the variable and choosing the setVariable option.
Thanks all of you so far for the great feedback. Keep it coming so we can make this extension awesome.
I have an issue with breakpoints. When I disable breakpoint which was caught earlier, debugger will still catch it every time it executes this line of code. Itâs completely random and I cannot reproduce it on demand, but itâs a little bit annoying.
I have had the same experience at times. So I am trying to rewrite the breakpoint experience from scratch. I will poke you when I have a new build to solve this problem.
just installed 2.4.0. Removing all breakpoints now cause error: âerror while processing request âsetBreakpointsâ (exception: Collection was modified; enumeration operation may not execute.)â
to clarify, problem happens every time I try to remove a breakpoint while debugger is attached
It works really well right now! It catches every breakpoint, and skip all removed BPs. Good work.
I found two more issues:
If you put breakpoints before attaching debugger, they will be âgrayedâ and debugger will skip them during execution. Once you put another breakpoint or remove one of the âgrayedâ breakpoints, they become active.
I found the way to freeze editor. Here is procedure to reproduce this issue:
Open project
Press play button
After few seconds press it again (turn off the game)
Go to vscode, then attach and detach debugger few times (press F5, then immediately Shift+F5, and repeat it 5-10 times)
Go to unity and press play button again
At this point editor is not responding to any command and I have to kill it