Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Visual Studio Tools for Unity not showing Unity instances

Discussion in 'Code Editors & IDEs' started by Axelieus, Oct 6, 2019.

  1. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    Hi,
    I'm running VS 2017 and any time I try to debug with multiple instances of Unity running, I am unable to connect the debugger. The "Select Unity Instance" dialog pops up, but doesn't list any of the running instances of Unity. If I close all other Unity instances it will connect to the single instance and the debugger works normally.

    Associated tool versions:
    VS 2017: 15.9.16
    VSTU: 3.9.0.3 (the change log lists 4.3.3.0 as the newest but Visual studio has no available updates)
    Unity 2019.2.8f1 (also happens with all other versions of 2019 that I tried)
     
    TakuanDaikon likes this.
  2. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    Bump. Am I the only one who has ran into this situation? I'm starting to wonder if there's something amiss with my dev environment.
     
    TakuanDaikon likes this.
  3. Dunk86

    Dunk86

    Joined:
    May 10, 2015
    Posts:
    53
    For what it's worth, I've been encountering this too. Visual Studio Community 2017 and Unity 2019.2.0f1. I'm running both Unity instances from the same project via sym-links (uEcho tool) for doing multiplayer development.
     
    TakuanDaikon likes this.
  4. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    Cambesa, TakuanDaikon and Dunk86 like this.
  5. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    576
    Cambesa likes this.
  6. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    119
    So i really need to upgrade to 2019, so much work to reinstall all plugins and setup all working environments again...
     
  7. shachash1984

    shachash1984

    Joined:
    Sep 28, 2015
    Posts:
    5
    did you try allowing the unity editor and visual studio via the Windows Firewall settings?
    worked for me
     
  8. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    This thread is well over a year old, turned out to be a known issue, and isn't an issue with newer Unity or VS versions. Might I advise reading the entire thread and check the dates before replying?
     
  9. danila290396

    danila290396

    Joined:
    Aug 23, 2018
    Posts:
    7
    Could you tell what the solution was? (of course, if you still remember) I have the same issue.
     
  10. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    If you look at my earlier reply, specifically the link to the MS forums, that explains the issue. Sadly there wasn't any resolution for VS 2017. The only way around it was to upgrade to VS 2019. Since then, the way Unity integrates with VS has changed as well. I don't recall which version of Unity in which this was first supported, but there's also a package you can download within Unity that enhances VS support.
     
  11. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    But that reply was incorrect. Visual Studio 2017 debugging has not been broken since Unity 2019. I'm not surprised Microsoft said the solution would be to give them $600 to upgrade to a newer version of their software :)
     
  12. danila290396

    danila290396

    Joined:
    Aug 23, 2018
    Posts:
    7
    Ah, that's a pity, thank you anyway)


    My VS 2017 worked pretty well in Unity 2019, the problem started with 2020.3.16f1
     
  13. vdogamr

    vdogamr

    Joined:
    Feb 23, 2018
    Posts:
    15
    Not that it is all that helpful but, this also only started for me when I upgraded from 2019.4.26f1 to 2020.3.18f1, and before that VS2017 worked just fine.
     
  14. heiwa-games

    heiwa-games

    Joined:
    Apr 8, 2018
    Posts:
    8
    same upgrade path for me (like vdogamr): I upgraded Unity from 2019.4.32f to 2020.3.22f1 and before that VS2017 could find unity instance easily. Now VS can't find Unity any more.
     
  15. Zarkow

    Zarkow

    Joined:
    Jul 27, 2015
    Posts:
    92
    So for Unity 2020 I need to upgrade to VS 2019 or later, to have the plugin work?

    Hopefully Unity 2020 will also launch 2019 for the when opening the C# within it, and the ongoing game in Unity 2018 with VS 2017 will keep doing it also, or things will get very complicated for any dev with multiple projects on their plate...
     
  16. Yiorgos

    Yiorgos

    Joined:
    Jun 5, 2013
    Posts:
    26
    I have the exact same issue with Unity 2020.3.9f1 and VS 2017: the "Attach to Unity" button won't find any Unity instances.

    Strangely enough, selecting Attach Unity Debugger from the Debug menu works just fine for me. Give it a try.

    upload_2021-11-25_19-30-11.png
     
  17. HgM3rK

    HgM3rK

    Joined:
    Jul 11, 2015
    Posts:
    2
    Genius! that fixed it for me!
     
    Yiorgos likes this.
  18. dasraiser

    dasraiser

    Joined:
    Sep 28, 2012
    Posts:
    6
    I loaded VS 1st and then unity and that seemed to solve this issue for me, thanks for the help :)
     
  19. rekatha

    rekatha

    Joined:
    Dec 18, 2017
    Posts:
    22
    Strangely enough, it's also work for me. Thank you.
     
    mrVentures likes this.
  20. tecnoluisao

    tecnoluisao

    Joined:
    Dec 9, 2015
    Posts:
    2
    Tkss
     
    mrVentures likes this.
  21. christinelimkl

    christinelimkl

    Joined:
    Sep 15, 2019
    Posts:
    1
    If it helps anyone, in my case (after updating to Unity 2020.3.39f1) it was that Debug Mode was turned off somehow. If you go to Edit > Preferences > Code Optimization on Startup you can flip it, or on that little bug icon on the bottom right of the Editor.
     
  22. ZanthousDevelopment

    ZanthousDevelopment

    Joined:
    Jul 12, 2023
    Posts:
    12
    Just here to say this is still an issue and this workaround is still valid unity 2022.7.f1 + visual studio 2022
     
  23. xtdiwd

    xtdiwd

    Joined:
    Jul 25, 2020
    Posts:
    128
    I use VS2017 and the yellow debug icon is already enabled.
    Although I do not see the item 'Code Optimisation on Startup' in Unity 2022.3.8
    My problem though is this: when I press in VS on "Attach unity debugger" I get a list of Unity instances, usually with different ports, but sometimes the port is the same in several rows.
    This is even though I only have one Unity instance open.
    How do I find out which port is the right one?
    Is there hope that this problem will be solved?
     
  24. xtdiwd

    xtdiwd

    Joined:
    Jul 25, 2020
    Posts:
    128
    Still the same problem: How do I find out which row is the right one?
     
  25. cpspace

    cpspace

    Joined:
    Jul 19, 2021
    Posts:
    6
    Yep same solution here.
     
  26. xtdiwd

    xtdiwd

    Joined:
    Jul 25, 2020
    Posts:
    128
    ???
    :confused::confused::confused:
    Pressing Attach Unity Debugger brings up a list containing many instances of unity.
    Already the fact that I have to go through that menu is annoying, but it would be helpful to know how to discover which of the many instances is the right one, considering that I really only have one open