- Home /
Unity keeps opening new instances of Microsoft Visual Studio
Every time i double click a script in Unity it open a new instance of Microsoft Visual Studio, even if that script is already open on a previus one. This takes a lot of time and MVS keeps showing mensages telling that the files modified in another program. Any Ideia whats going on and how to fix it? I just want to open the files in some new tab, not a whole other program.
Go to yo ur preferences and change it to $$anonymous$$ono, although it does the same thing, but it wont open multiple instances.
Personally I use Notepad++ as its the quickest easiest thing to use. Plus the latest update has added coding shortcuts.
Really though, you dont need to double click files from Unity. They should all be accessible directly from VS anyway.
Answer by baheard · May 06, 2016 at 09:08 AM
I had this problem as well, I believe it was related to upgrading a project to a new version of unity. I resolved it by deleting the .csproj files and the .sln file for the project. Unity just recreated them immediately, and the files correctly opened in the same instance of VS.
Answer by Punfish · Dec 05, 2017 at 06:01 PM
I encountered another situation where the accepted answer did not work. When you first install Visual Studio and try to open a CS file through Unity it will prompt you, asking which program to open the CS file with. Often the only option is Visual Studio Version Selector; this is not the right answer. Instead within Unity go to the Edit menu bar -> Preferences -> choose External Tools. Under External Script Editor click browse and search for DevEnv within your Visual Studios folder. Usually found under
C:\Program FIles x86\Microsoft Visual Studio\Version##\Community\Common7\IDE\
Answer by Nazirzadeh · Nov 07, 2018 at 05:36 AM
Just close the Unity, then only clean the .sln file located in your project folder.
Answer by nikokoneko · May 06, 2018 at 08:02 AM
It still happens to me on Macos, Unity 2018.2.0b3. Nothing helped, and it's making it completely impossible to work. It's been frustrating lately as there hasn't been a version of Unity in over a year that didn't had at least one (often more) deal-breaking bug that made it useless...
Actually I have to admit I didn't try your solution because on $$anonymous$$acOS I wasn't really sure what app should I pick (just browsing for VS app yielded same results as selecting Visual Studio directly in Preferences).
I don't know what the file structure looks like for the VS install on a $$anonymous$$ac but if like a Windows computer there are many applications (exe win, app mac) to choose from in the Visual Studio folder and sometimes the app selector picks the wrong one. Generally speaking with development programs there is a CO$$anonymous$$$$anonymous$$ON folder, then an IDE folder somewhere nearby, and commonly in the IDE folder you will find the application to choose.
You could try emulating Windows or dual booting into Windows, as dev tools tend to work better on Windows versus $$anonymous$$ac. I know that's not an ideal solution but it may be the best one. I've personally been with Unity on Windows for over 2 years and I haven't had any issues I wasn't able to quickly resolve.
I had the same issue, and realized that in my Applications, there were two versions.of visual studio installed. One had old in the title, and deleting that solved my issues.
Same Issue appeared after i updated my unity... Now I am on $$anonymous$$acOs 10.12 and Unity 2018.2.0b3.
Didn't work for me. The problem is appearing on macOS and "Unity 2020.1.6 & 1.5". When I downgrading project to 2019.3, the problem is fixing for me
Answer by EddieOffermann · May 23, 2018 at 07:23 PM
I wrote a long, very detailed explanation of the steps I took to resolve this VERY persistent problem and the site errored... I don't have time to write it all again.
Short version:
Do everything listed above.
Rt-click on a .cs file and select "Get Info"
Change default application for all files of that type to open in Visual Studio
Create a new project and solution in Visual Studio. Add the existing Assets folder to the project.
There's more that I did to make this work really, really well but my prior post had >20 steps.
After that happened to me a couple of times, I've taken to writing on a text editor or word processor then pasting the result to the web.