Unity Debugger Extension for Visual Studio Code 2.0.x Preview Release

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.

Please report any kind of feedback in this thread and help us track issues by reporting them on the GitHub repo: Pull requests ¡ Unity-Technologies/vscode-unity-debug ¡ GitHub

Download

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.

  • Choose to uninstall.

Release notes
===2.6.6===

===2.5.0===

===2.4.2===

===2.3.0===

===2.2.0===

===2.1.0===

===2.0.0===

  • Updated debugger libraries to support .NET 4.6 runtime in Unity.

  • Fix issue with being able to detach from Unity, which would cause the Unity Editor to hang.

  • Various instabilities fixes, such as LINQ debugging for .NET 4.6 runtime, hovering variables, complex class debugging etc.

Minimum Requirements
All Unity versions. For the best debugging experience with .NET 4.6 runtime we recommend using Unity 2018.1 and above.

Known issues and missing features

  • LINQ expressions are not validated from debugger-console or the watch list.

Source code repositories

4 Likes

I will try it out later today and report if there are any problems, just wanted to say thank you, epic! :smile:

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

Awesome to hear that you are excited about this. :slight_smile:

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 :slight_smile:

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 :slight_smile:

@miniwolf_unity thank you for reply.
This happen after attaching debugger to Unity.

VS code -Version 1.22.1
Unity 2018.1.0b13
macOS 10.13.4

1 Like

Alright yes, I see the problem. I have rolled out a new fix that should fix this issue.
I have updated the description with the new link. Or you can download it from here:
https://github.com/Unity-Technologies/vscode-unity-debug/releases/download/Version-2.0.1/unity-debug-2.0.1.vsix
Thanks for putting my attention to it :slight_smile:

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

Thank you it works fine!

I found another issue. It looks like some of LINQ requests still not working in the debug session.

3459513--274344--upload_2018-4-12_15-34-36.png

I see. Maybe it is a missing feature in the mono debugger in general. @CodeFighter Does this work under Visual Studio for mac?

Yes it works in Visual Studio for mac and in Rider.

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.

1 Like

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.

3 Likes

Great job!

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. :slight_smile:

2 Likes

I have released 2.4.0 this should hopefully help with some of the issues with breakpoints. Tell me if this works for you @andrzej_cadp

1 Like

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:

  1. 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.
  2. 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