Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. 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

Can't see "Attach to Unity" button in Visual Studio

Discussion in 'Editor & General Support' started by CesarOrozco, Mar 30, 2017.

  1. CesarOrozco

    CesarOrozco

    Joined:
    Dec 30, 2016
    Posts:
    6
    Hi,

    I have downloaded the latest Unity and Visual Studio versions, and I'm trying to debug a script but I can't see the "Attach to Unity" button in Visual Studio, I have seen some videos and the button should be here:



    I tried to search but I couldn't find anything related to the missing button, any ideas?

    Thanks!
     
    DoomDude99 likes this.
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,622
    What version of visual studio do you use? The one that comes packaged with unity seems to work fine out of the box for me...
     
  3. CesarOrozco

    CesarOrozco

    Joined:
    Dec 30, 2016
    Posts:
    6
  4. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,622
    Did you try the one packaged with the unity install? Or downloaded separately?
     
  5. CesarOrozco

    CesarOrozco

    Joined:
    Dec 30, 2016
    Posts:
    6
    I tried both of them, first with the one packaged with Unity and then the other one
     
    rossk likes this.
  6. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,622
    Hmm. So you say you also used the "vs tools for unity" (I think thats what the installer says) when installing right? If that all went correctly I'm not sure why thats happening, because I see the button:

     
  7. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    207
    The 'button' is a menu item under 'Debug'. There's no button on the main interface. The 'Attach...' button that MD_Reptile is showing is for attaching to standard applications (not Unity ones).
     
    Danarchy likes this.
  8. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,622
    Opps my bad.
     
  9. Reahreic

    Reahreic

    Joined:
    Mar 23, 2011
    Posts:
    139

    I question the correctness of the highlighted (red) portion of the above statement. The below is a screenshot shows that the Start button is replaced with Attach to Unity.



    Currently i have it attached correctly, yet my co-worker next to me can't get it to attach. We've both selected VS 2017 in the unity preferences as that came installed by default (5.6) Both have VS2017 tools for unity installed and enabled.


    EDIT: This fixed it for my co workers (YMMV):
    1. Close VS
    2. In Unity Select File > Build Settings
      1. Select the Development Build Checkbox
    3. Save Project
    4. In Edit > Preferences > External Tools
      1. Re-select your VS IDE (VS 2017)
    5. Double Click a script and let Unity initialize VS
     
    Last edited: Jul 12, 2017
  10. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    207
    The highlighted text is correct. The standard "Attach..." button that is shown when you have no solution open is for attaching to non-Unity applications. It is equivalent to selecting "Debug->Attach to Process...", when what you want for Unity apps is "Debug->Attach Unity Debugger".

    If you have a button on the main interface that says "Attach to Unity", then that's a different button to what I (and MD_Reptile) was talking about. If you have this button (I don't, "Attach..." becomes "Start" for me when I have a solution open) it's probably safe to use it.
     
    MD_Reptile likes this.
  11. lilQ

    lilQ

    Joined:
    Feb 21, 2018
    Posts:
    1
    This worked for me as well. Thanks!
     
  12. bhallion

    bhallion

    Joined:
    Mar 26, 2018
    Posts:
    4
    Thanks !

    This was crucial for me.
    Also I didn't installed the unity extension at all so you might need to install the extension using "Visual Studio Installer".
    vsi.png
    (Source: https://forum.unity.com/threads/support-for-visual-studio-2017-rc1.444124/ )
     
    jayamohanan96, isgoed, EVART and 2 others like this.
  13. BrockKunz

    BrockKunz

    Joined:
    Oct 25, 2018
    Posts:
    1
    I am having this same issue. I have tried all of the suggestions posted here, and it still has not fixed my issue. My debugger button just says "Start". I do seem to have Unity specific intelliSense. However, if I right click as I have seen some do there is supposed to be an option to implement some Unity specific methods, and I am not seeing that option either.

    I have uninstalled Unity and Visual Studio and reinstalled them several times without any real result. Also when installing Visual Studio Community 2017, I only select the to install Game Development with Unity option, everything else is default.

    I have set Visual Studio 2017 Community as my default external editor in Unity preferences. I also have "Create Visual Studio Solution" and "Development Build" selected in the build settings.

    I have no idea what else to do... I am able to attach the debugger through the debug menu. However, doing this over and over becomes cumbersome and inconvenient when you have to do it so many times.

    Current Unity Build Version: 2018.3.0f2

    Microsoft Visual Studio Community 2017
    Version 15.9.5
    VisualStudio.15.Release/15.9.5+28307.280
    Microsoft .NET Framework
    Version 4.7.03190
    Installed Version: Community
    C# Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
    C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
    NuGet Package Manager 4.6.0
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
    ProjectServicesPackage Extension 1.0
    ProjectServicesPackage Visual Studio Extension Detailed Info
    Visual Basic Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
    Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
    Visual Studio Code Debug Adapter Host Package 1.0
    Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
    Visual Studio Tools for Unity 3.9.0.3
    Visual Studio Tools for Unity

    Any help will be much appreciated!
     
  14. sonicsquirrel9999

    sonicsquirrel9999

    Joined:
    May 6, 2019
    Posts:
    13
    Same problem here. Odd thing is, when at first I am starting up VS, as it is loading I can see the Attach to Unity button. However when it finishes loading, the button is replaced by the Start button. Not sure what's going on...
     
    Tony_Max, StarDrake and arcanemathieu like this.
  15. furkan59

    furkan59

    Joined:
    Apr 18, 2017
    Posts:
    6
    may be some updates make this error. Same thing happens to me today. I am using vs 2019 for unity. Tools for unity is installed. But I can not see attach to unity button.
     
  16. furkan59

    furkan59

    Joined:
    Apr 18, 2017
    Posts:
    6
    I have vs 2019 and vs 2017 both could this be a reason for this ?
     
  17. furkan59

    furkan59

    Joined:
    Apr 18, 2017
    Posts:
    6
    I have deleted vs 2017 and problem still exists

    I have tried deleting vs tools for unity for 2019 and reinstall it. Still not solved.
     
  18. furkan59

    furkan59

    Joined:
    Apr 18, 2017
    Posts:
    6
  19. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,622
    Thanks for posting what solved it for you! :)
     
  20. x421

    x421

    Joined:
    Oct 14, 2019
    Posts:
    1
    removing the (hidden) .vs folder from my unity-project-folder finally resolved this problem for me :)
     
    MD_Reptile likes this.
  21. EVART

    EVART

    Joined:
    Jun 15, 2015
    Posts:
    1
    frite333 and bhallion like this.
  22. Bakhtiyargill

    Bakhtiyargill

    Joined:
    Feb 13, 2020
    Posts:
    1
    My VS2019 Tools for Unity was disabled by performance manager. These tools caused visual studio to be unresponsive. That's why performance manager disabled it . I enabled it and this worked for me
     
  23. bhallion

    bhallion

    Joined:
    Mar 26, 2018
    Posts:
    4
    Annotation 2020-02-18 114719.png
     
  24. Chrisc2600

    Chrisc2600

    Joined:
    Jan 29, 2016
    Posts:
    1
    My VS2019 was missing the attach to Unity as well. Here's how i fixed it.

    The Attach Unity Debugger will not show up unless you have installed the "Game Development with Unity" addon by going to youre menu item Tools / Get Tools and Features. From the Visual Studio Installer under workloads you'll see the option to turn on 'Game Development with Unity'. May take a few minutes to install.


    you can all so open the Visual Studio Installer separately and select modify from the installer which will bring up the above dialog.

    Once installed you should see the Attach to Unity under the Debug menu.
     
  25. andreapomposelli

    andreapomposelli

    Joined:
    Apr 24, 2014
    Posts:
    4
    In case you still have an issue, this should automatically fix potentially issue on the project :
    Preference > External Tool > Regenerate project file

    upload_2020-5-23_23-49-51.png
     
  26. favoritjj

    favoritjj

    Joined:
    Jul 1, 2020
    Posts:
    1
     
  27. amcakebread

    amcakebread

    Joined:
    Nov 8, 2016
    Posts:
    25
    worked for me - thanks
     
unityunity