Search Unity

VS Debugging freezes Unity on Play Start

Discussion in 'Code Editors & IDEs' started by TriNityGER, Aug 31, 2018.

  1. TriNityGER

    TriNityGER

    Joined:
    Sep 1, 2017
    Posts:
    29
    I think it started to appear after the latest VS 2017 update 15.8.2 with the Tools for Unity 3.8.0.6 installed.
    Whenever I start attaching VS to Unity and start the game via the Play Button, the whole editor freezes.
    If I try to stop the debugging, the editor works again but now VS is frozen! It takes an eternity for VS to recover.

    Any ideas? Is the problem known?
     
  2. rich-brighton

    rich-brighton

    Unity Technologies

    Joined:
    Jun 13, 2016
    Posts:
    10
  3. rich-brighton

    rich-brighton

    Unity Technologies

    Joined:
    Jun 13, 2016
    Posts:
    10
    @TriNityGER do you use the [InitializeOnLoad] attribute in your project at all?
     
  4. Jcardoso

    Jcardoso

    Joined:
    Oct 6, 2014
    Posts:
    3
    had a similar problem, that end up by being too much old breakpoints, clean all the breakpoints and everything start working smoothly :)

    My current environment is :

    VS 15.8.5
    VS Unity Tools 3.8.0.7
     
    Vad3rInHale and little_box like this.
  5. TriNityGER

    TriNityGER

    Joined:
    Sep 1, 2017
    Posts:
    29
    Sorry for never getting back! Yes we used the InitializeOnLoad attribute in one special class.

    But great news! After updating VS from 15.8.4 to 15.8.5 everything is back to normal! I can finally step through my breakpoints as usual without any freezes or anything. I suspect that one of the debugger fixes from that update to fix the Unity/VS issue even though it is only for Android/IOS. Or maybe the fix was never documented.
     
  6. little_box

    little_box

    Joined:
    Aug 22, 2017
    Posts:
    28
    Thank you, same problem.