Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Our response to Improbable’s blog post (and why you can keep working on your SpatialOS game). Read more here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    5
    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!
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,371
    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:
    5
  4. MD_Reptile

    MD_Reptile

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

    CesarOrozco

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

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,371
    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:
    204
    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).
     
  8. MD_Reptile

    MD_Reptile

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

    Reahreic

    Joined:
    Mar 23, 2011
    Posts:
    95

    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
    acrego87, SanyaBane, bhallion and 5 others like this.
  10. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    204
    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:
    2
    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/ )
     
    enok82 likes 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!