Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Visual Studio 2019 - No 'Attach to Unity' debug option

Discussion in 'External Tools' started by andrewhoke, Apr 18, 2019.

  1. andrewhoke

    andrewhoke

    Joined:
    Aug 29, 2018
    Posts:
    22
    I installed VS2019 when it was released, and have been enjoying using the new features; however, I've had nonstop issues with the Unity development extension not working. No matter how I open VS, I don't get the attach option. I've tried running as admin and opening the project from the Editor in Assets->Open C# Project. I've been forced to revert to using VS2017 multiple times.

    For what it's worth, my project is currently stuck in 5.6.6f2 (yeah, I know), but I have seen this same issue when working in the QA version that is now in 2018.3.1f1.
     
  2. GeoffBot

    GeoffBot

    Joined:
    Oct 25, 2018
    Posts:
    3
    Using latest 2018 Unity build and had to revert to VS2017, all is well again. I'll wait until Unity bundles VS2019 before I try it again. Currently they still bundle 2017.
     
  3. andrewhoke

    andrewhoke

    Joined:
    Aug 29, 2018
    Posts:
    22
    Shame they would release the extension for VS2019 but not support it... :rolleyes:
     
  4. PabloAM

    PabloAM

    Joined:
    Dec 25, 2012
    Posts:
    35
    Please Unity release VS2019 support extension :)
     
    ROBYER1 likes this.
  5. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    842
    Hoping for an update on this so I can use VS 2019
     
  6. potterdev245

    potterdev245

    Joined:
    May 3, 2019
    Posts:
    1
    Until they do you can use:
    VS -> Debug -> Attach unity debugger -> double click project
     
  7. beefyt123

    beefyt123

    Joined:
    Mar 11, 2014
    Posts:
    1
    If you install the Visual Studio tools for Unity manually. The Attach to Unity option re-appears, and Intellisense is now offering unity functions for auto complete.

    1. Run Visual Studio Installer
    2. On the version of VS2019 you have installed click Modify
    3. At the top of the window navigate to Individual Components
    4. About 2/3 of the way down you will see a subtitle "Games and Graphics" make sure Visual Studio Tools for Unity is checked.
    5. In bottom right click install.
     
  8. andrewhoke

    andrewhoke

    Joined:
    Aug 29, 2018
    Posts:
    22
    This was always the case @beefyt123 and the manner in which I installed the VS Tools for Unity extension. I updated to Visual Studio 2019.1.1 today so we will see if that fixes the issue for good.
     
  9. furkan59

    furkan59

    Joined:
    Apr 18, 2017
    Posts:
    6
    it works for me you are my hero.
     
  10. BroncoBilli

    BroncoBilli

    Joined:
    Oct 8, 2017
    Posts:
    74
    Yes, the attach option works. Just today, I installed VS 2019 from scratch, ensured the VS Tools for Unity was checked, and installed Unity 2019.2.0... When I double click on the script file in unity, and it opens up VS 2019, there is no way to press the green Play button and start debugging. I MUST go and attach to unity. I don't know why Beefy's solution works, but it doesn't for me. There are a lot of options in Unity and in the VS Tools for Unity extension, I don't know what, if anything, modifying them would help with.
     
  11. andrewhoke

    andrewhoke

    Joined:
    Aug 29, 2018
    Posts:
    22
    I finally got my project upgraded to Unity 2018.3 and the attach option is working consistently. I imagine it was a compatibility issue with Unity 5.4.
     
  12. guodancoder

    guodancoder

    Joined:
    Dec 14, 2017
    Posts:
    2
    gooooooooooood
     
  13. PetterL68

    PetterL68

    Joined:
    Jun 26, 2018
    Posts:
    20
    I had first problems with the connection to Unity. After reinstall the VS 2019 it work. But when i want to lookup some commands by using Ctr+ALT + M and Ctrl + H, i get a
    search option insted and if i let it search, it takes forever.


    Edit: Tried to revert back to 2017, but the same search box appears when trying to look up
    Mono commands with Ctrl+ALT +M and Ctrl +H.
    Looks like it is the search and replace box that appear.
     
    Last edited: Aug 25, 2019
  14. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    195
    This fixed the issues! Thank you so much. After I installed VS2019, everytime I clicked on a Script it would open a new instance of VS. Now its all good!
     
  15. mcaldei01

    mcaldei01

    Joined:
    Dec 8, 2017
    Posts:
    6
    Be sure to follow the mentioned steps above first (Install Visual Studio Tools for Unity), but if still does not work (in my case with version 18.3.3f1), do this:

    - Exit Visual Studio if opened.
    - With Unity opened go to Edit\Preferences\External Tools (check you have VS 2019 as External Script Editor) and set Editor Attaching to FALSE and then exit Unity.
    - Open Unity and go again to Edit\Preferences\External Tools and set Editor Attaching to TRUE and exit Unity
    - Open Unity again and then Open Visual Studio.

    It should work now.
     
    niara, nirflysher, vlater and 4 others like this.
  16. cloakedninjas

    cloakedninjas

    Joined:
    Jul 20, 2018
    Posts:
    4
    Nope - at least not for Unity 2019.2.17f1 and VS 16.4.3
     
  17. jdmac020

    jdmac020

    Joined:
    Nov 16, 2016
    Posts:
    1
    This did the trick for me,
    VS2019 Community 16.4.3
    and
    Unity 2019.2.19f1
    . Thanks for reminding me about the external editor setting!!
     
    mcaldei01 likes this.
  18. TaNoX80

    TaNoX80

    Joined:
    Oct 8, 2019
    Posts:
    1
    Thank You Absolutely did the job for me!
     
    mcaldei01 likes this.
  19. nirflysher

    nirflysher

    Joined:
    Nov 5, 2017
    Posts:
    1
    This worked for me as well
     
    mcaldei01 likes this.
  20. whitesundreams

    whitesundreams

    Joined:
    Jan 23, 2020
    Posts:
    5
    I am suddenly having this age old issue today. I did not update VS2019 or Unity. Suddenly the Attach to Unity Option has disappeared. I am going to try to reinstall the unity tools.

    I tried to reinstall Unity's Editor and Unity Tools from the Visual Studio 2019 install tool, but that did not work.
     
    Last edited: Feb 13, 2020
  21. whitesundreams

    whitesundreams

    Joined:
    Jan 23, 2020
    Posts:
    5
    For whatever reason, it won't automatically show the attach to Unity. However I can still do it through the Debug options. Attach to Unity. Perhaps there was something that was hot patched?

    EDIT: And the next day it is suddenly back.
     
    Last edited: Feb 15, 2020
    mcaldei01 likes this.
  22. unity_1656rcYRBSHMmw

    unity_1656rcYRBSHMmw

    Joined:
    Jun 22, 2018
    Posts:
    1
    For Newbie’s Like me. After updating to Visual Studio 2019 I lost the Debug facility, I followed the procedure above/ Preferences/External Tools. At the top by External Script Editor the were some unusual Characters. I clicked on the dropdown list and there was Visual Studio 2019 (Community) after selecting that Debug works fine. Another issue for beginners. When I tried to download Visual Studio the page opened up Minimized and I could not find the Unity addon then the penny dropped and I clicked the maximize button and all was revealed.
     
  23. cgascons

    cgascons

    Joined:
    Feb 22, 2016
    Posts:
    11
    My 2 cents here, had the same issue today. Tried everything, some of the setting attributes stated in some of the posts above could not be found on my Unity Version (2020.1.0a25.3171 on Mac), so I finally figured out that the only thing that changed from yesterday (when I was debugging completely fine) and today is that I switched platform from Android to iOS. Reverting back the platform to Android made the Debug option appear back and everything's now working as intended.
     
    Last edited: Jun 11, 2020
  24. gprovs

    gprovs

    Joined:
    May 21, 2020
    Posts:
    1
  25. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    161
    From VS installer... Individual Components -> Visual Studio Tools for Unity

     
unityunity