Search Unity

Can't attach Unity to Visual Studio

Discussion in 'External Tools' started by DrDress, Sep 16, 2019.

  1. DrDress

    DrDress

    Joined:
    Sep 11, 2019
    Posts:
    12
    Ok I updated to VS 2019 I now I can select this:




    But now I get this option:


    I don't know what to do here. The "OK" button is greyed out :-(. Any help?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,732
    Can you select Evolution position?
     
  3. DrDress

    DrDress

    Joined:
    Sep 11, 2019
    Posts:
    12
    Aaah... yeah I might have tried that myself... Oh well it did the trick. Thanks alot!
     
    Antypodish likes this.
  4. DrDress

    DrDress

    Joined:
    Sep 11, 2019
    Posts:
    12
    Well actually it works a little odd. When I select Evolution it starts debugging, and when I start in Unity it will run the scripts and get stuck in the breakpoints as it should. But when I stop again the debugging also stops and I can edit the code again. But I then have to do all the same stuff again if I want to run in debugging mode again. That's pretty annoying. Isn't there a way to always start the debugger in VS when I run in Unity without a lot of manual stuff?
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,732
    Technically once you attach, it should stay attached.
    But as far I have experienced unfortunately, Latest Unity with VS is quite temperamental.
    Which version of Unity you are using?
     
  6. DrDress

    DrDress

    Joined:
    Sep 11, 2019
    Posts:
    12
    version 2019.2.0f1
     
  7. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    74
    You should only need to press F5 (Or Start button) to attach to your Editor in your case.

    Using "Attach to Unity debugger" is useful when:
    - you want to debug a local or remote player
    - you have several editor instances running
    - you want to do orchestrated debugging, like debugging the editor and several players at the same time

    Seb
     
  8. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,732
    Is not always true, since VS sometimes don't want to attach at all. Restarting both Unity and VS is best remedy in my case.
    However, I
    am not sure if that is more VS, or actually Python related, as I had been installing recently python and had some conflicts with VS version of python. Coincidentally I upgraded Unity to 2019 at the same period. And VS Unity attaching troubles become more often since then.

    Reinstalling VS didn't help.