- Home /
Visual Studio breakpoint freeze.
I'm using Visual Studio 2015 to write my code. And I'm used to use breakpoint to debug. But every time i try to place a breakpoint, attract to unity and play. Then Unity will just freeze and then i have to close unity though the task manager. I'm using Unity 5.4.0f3 and Visual Studio 2015 14.0.24720.
When you use a breakpoint when the code reaches the breakpoint you need go to visual studio, step over the code, press continue, or press stop debug to continue the unity execution.
That is what I want. But that never happens, unity just freezes and never runs into the breakpoint. It like there is a thread, which have run into a deadlock or something.
Unity will freeze, but visual studio will stop at the breakpoint, and you need debug in visual studio, you cant debug in unity directly.
I have the same problem. I narrowed down the cause to a single line where I am subscribing to the IsAvailableChanged event of a $$anonymous$$inectSensor instance. It doesn't matter if the event handler is blank - subscribing to the event is enough to freeze Unity. General Events don't seem to be a problem as I can subscribe to other custom events.
I hope this helps somewhat. I'm using Unity 5.4.0f3 and Visual Studio 2015 14.0.25425.01 Update 3
Same is happening to me, but when subscribing to another native dll. Did you find a solution for this?
No I didn't. Ins$$anonymous$$d I used logs to check variables and control flow and I shamelessly commented out the part when I did want to debug other parts. $$anonymous$$y project was a small one so I didn't really want to spend the time. Good luck on yours.
I have a similar issue in some cases, but not in others. Often, I can place breakpoints and they work properly, other times, the very existence of a breakpoint will result in Unity and Visual studio hanging, requiring a force-close. The breakpoint is never hit in this case.