I have no problem breaking VS on placed break points when debugging but if unity code throws an exception then Unity can be made to pause the game and show where the error occurred in the console…
but I want it to switch to VS and show the current call stack, variable values etc. - should I be able to?
As it is, I have to repeat the actions with a new breakpoint at the point of exception to get a proper look at the error in VS, seems a Unity limitation
Sorry to necro this, but is the mentioned setting above really the solution?
Would also like that when the NullReferenceException occurs (unintialized variable etc.), the debugger should stop to show me which variable is the culprit (since the error log does only provide the line and sometimes have multiple reference sin the same line).
However despite this (which already was enabled) no exceptions are thrown.
There’s a separate, Unity-specific exception called “MissingReferenceException” which is thrown in the Editor when a reference to a Unity object is a “fake null”.
Also, sometimes I have to toggle the exception off then on again after attaching the debugger for it to stick.
For folks wondering how to add the MissingReferenceException in VS:
Right click “Common Language Runtime Exceptions” in the screenshot above, hit the plus-icon and add “UnityEngine.MissingReferenceException”
And yes, I’ve also seen a lot of flakyness with getting this to work reliably like needing to toggle exceptions on and off to get it to work (never had a problem with any other targets than Unity).