Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Editor opening random versions of VS

Discussion in '2020.1 Beta' started by Graep, Apr 15, 2020.

  1. Graep

    Graep

    Joined:
    May 29, 2013
    Posts:
    7
    Hi,

    Recently updated to 2020 (happens on both b4 and b5) and I'm getting an issue where scripts randomly open in random versions of visual studio which I have a few versions of because I'm a goober.

    I can't really see a pattern and it's not too bad but just thought I'd post it and see if anyone had a fix.
     
    richardkettlewell likes this.
  2. JWRealmforge

    JWRealmforge

    Joined:
    Jan 7, 2020
    Posts:
    5
    Same problem for me. Installed versions are Visual Studio 2019 Community and Visual Studio 2015 Community.
    The External Script Editor setting is set to Visual Studio Community 2019 but Unity opens 2015 most of the time. I tried selecting the 2019 Executable directly but that didn't make a difference.
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    Occasionally it opens raider which I also have - one thing I also noticed was especially when it does this, it wants to reload files
     
  4. miniwolf_unity

    miniwolf_unity

    Unity Technologies

    Joined:
    Apr 10, 2018
    Posts:
    141
    Are you using the Visual Studio package? You can see this under the package manager.
    If not, try adding this package.
     
  5. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    Yep already had that, and checked it was updated.
     
    miniwolf_unity likes this.
  6. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    168
    Hello,

    Several questions for you:
    - Just to double check, could you confirm the exact version of the VS package you are using?
    - In Unity what do you see in Edit/Project Settings/Editor/Additional extensions to include (C# Project Generation)
    - Do you think it is really random, or perhaps more related to the extension of the file you are trying to open.

    Thanks!
     
  7. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    well..

    so far the new beta hasnt done it.. but it was definitely random as you'd double click get vs and double click same file expecting it to bring vs to the front and it would load rider..
     
  8. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    168
    We saw that with an initial version of the package (1.x). The package was not properly recognizing the extension as handled by VS, and instructed Unity to fall back to the default system Editor for this extension.

    But with version 2.x+ it should be resolved.
     
  9. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    OK it just happened again but when i closed rider which i hadnt even actually had open the file I wanted, i noticed vs had a dialogbox with reload file.. im wondering if its picking another editor because vs has a dialogbox up and isnt responding
     
  10. Graep

    Graep

    Joined:
    May 29, 2013
    Posts:
    7
    I'm using 2.0.1. I can force it to use VS2017 by regenerating the project files, but it seems to revert occasionally.
     
  11. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    mine seems to have stopped now i changed windows to default to having cs files opened by the same version of vs. It seems then randomly it skips the one you select and tries the windows default
     
  12. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    168
    Indeed, when a modal Window is opened in VS, Unity is unable to communicate anymore and will fallback to the default system handler for the file extension used.

    Could you give us your exact VS version ?
     
  13. Symo7

    Symo7

    Joined:
    Mar 2, 2014
    Posts:
    23
  14. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    I have 15.9.22 and 16.5.4 (should be using the latter by request)
     
  15. schaefsky

    schaefsky

    Joined:
    Aug 11, 2013
    Posts:
    90
    Hello, this might be relevant:
    https://forum.unity.com/threads/uni...project-files-can-not-attach-to-unity.884683/

    Also:
    upload_2020-5-7_21-1-48.png
     
  16. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    168
  17. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    168
    Ok so I think we fixed the issue. Until we release a new package, a possible workaround is to use "Asset/Open C# project" once, everytime Unity is launched, to properly initialize the state and open Visual Studio. Then you should be able to open scripts properly from Unity.

    Sorry for this.