Skip to content

[BUG] Unity - break on exceptions not working #1784

@tomerbarkan

Description

@tomerbarkan

Describe the Issue

When debugging a Unity project with Visual Studio code using the official C#, C# Dev Kit, and Unity plugins by microsoft, the checkbox to break on User-Unhandled Exceptions or All Exceptions do not work.

This feature works well with Unity in Visual Studio and in Rider, but not in Visual Studio Code.

Steps To Reproduce

In a Unity project with C#, C# Dev Kit and Unity plugins

  1. Debug a Unity project by attaching the debugger to the Unity editor.
  2. Open the Run and Debug panel, in the Breakpoints section, enable the User-Unhandled Exceptions checkbox
  3. Set your code to throw an exception, any exception
  4. Run the project in Unity, reach the code that throws an exception.

Expected Behavior

Expected: The debugger will break when the exception is thrown
Actual: The exception is logged in the Unity log, but the execution continues and the debugger does not break

Environment Information

  • OS: Windows 10
  • VS Code: 1.97.2
  • Unity: 2021.3.29f

Metadata

Metadata

Assignees

Labels

area-unityUnity supportbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions