Search Unity

Question Visual Studio - Keeps Opening

Discussion in 'Code Editors & IDEs' started by rmele09, Aug 24, 2023.

  1. rmele09

    rmele09

    Joined:
    Nov 8, 2010
    Posts:
    716
    Every time I double click a script within unity, it opens a new instance of visual studio instead of creating a new tab within visual studio for the new script. This is really slow and driving me nuts lol is there a way to fix this so that all scripts that you open from unity create tabs within one instance of VS? As it is, I have to wait for visual studio to boot up every time I open every script…I dont know why this started doing this. Unity 2022 and VS 2019. Different versions of VS are still doing it, both newer and older.

    Thanks!
     
  2. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi!

    It is not the expected behavior indeed.

    - Please make sure you are using the latest VS Editor Package in your Unity project (should be 2.0.20 as of today). [Window / Unity package manager]
    - Double-check that Visual Studio is set as your preferred external editor in Unity (do not use internal open). [Edit / Preferences / External tools]
    - We recommend using VS2022.

    Thanks!
     
    rmele09 likes this.
  3. rmele09

    rmele09

    Joined:
    Nov 8, 2010
    Posts:
    716
    Thank you. Installing the package fixed the issue!
     
  4. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    27
    I've installed version 2.0.22 and I'm experiencing the same problem when I click on any error debug on the Unity console. It keeps opening a new instance of VS2022 with the file that raised the error, it should open the file on the current instance of the IDE I suppose. Thank you for your time!
     
  5. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    27
    I'm sorry, adding another answer here since I think I've found a possible cause (or at least a way to reproduce the issue).
    if I set the VS2022 "Solution Explorer" to "Folder view", every time that I open a file from Unity it launches a new instance of VS. In the new instance, if I keep the default "solution explorer" view, it works as expected.

    I'm trying to have a setup similar to VSCode so I want to have the Solution Explorer with the Folder View visible to select files... is there a better way to have the list of files visible?

    (Unity version is 2022.3.9f1)