Unity Visual Studio



When I open a script for editing from Unity, both Visual Studio and Monodevelop are launched, resulting in two instances of the same solution to be open in two different script editors.

I am presently running the latest version of Unity 5.50fs (though I also experienced this issue in the previous build prior to installing Unity's latest update), in conjunction with Visual Studio Community Edition 2015, and Visual Studio Tools For Unity 2.3.0.

Unity Visual Studio

Oct 25, 2019 Overview Visual Studio Tools for Unity is a free Visual Studio extension that turns Visual Studio into a powerful tool for developing cross-platform games and apps with Unity. While the Unity editor is great for putting your game world together, you can't write your code in it. Most of the times, restarting Unity and Visual Studio should fix this. I can't tell which one is causing the problem but I will cover the most likely solution to fix this. Fix Part 1: Download and Install Visual Studio Tools for unity from this link. Do this while Unity and Visual Studio are both closed.

Unity Visual Studio Code

Unity visual studio 2019

I also have my external script editor set to VS in the preferences window of Unity.

While investigating this issue I came across a forum thread of someone experiencing a similar problem, where MD opens instead of VS. This seemed to be a result of a hard coded reference to MD for redundancy in cases where VS might fail to load, which I thought sounds like a plausible explanation for my situation as well.

Working

The general consensus was that when VS takes a little too long to open, Unity reverts to MD under the assumption that their is a problem with VS. This explanation seems even more likely in my case because this issue only occurs when I first open Unity for the day- if I have had VS open recently MD does not open, and VS opens quite quickly, likely a result of being cached in my computers memory.

Visual Studio Unity Tools

The work around offered to avoid MD launching instead of VS in that thread, was to change the name of the MD executable, so that Unity would be unable to launch MD, giving VS time to finish loading. I was however hoping to find a better solution. I like the fact that Unity has that redundancy in place and would rather keep it intact, and I don't know why but changing the executable solely for that purpose makes me feel a little OCD.

Visual Studio Not Showing Proper Suggestions - Unity Forum

Other ideas I have tried include reinstalling Unity, running both Unity and VS as an administrator, and launching VS prior to opening the script in Unity (in this case Unity opens a second instance of VS).

Visual Studio Not Auto-completing Unity Components? - Unity Forum

Has anybody else experienced both script editors being launched simultaneously and/or have any other ideas on how to resolve it? It's obviously not a critical issue or anything, but it is a bit annoying.