1
\$\begingroup\$

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.

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.

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.

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.

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).

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.

\$\endgroup\$
1
  • \$\begingroup\$ I have also tried setting both Unity and Visual Studio to always run as administrator as this seems to have resolved the issue for some people, but the problem persists. \$\endgroup\$ Jan 27, 2017 at 11:12

2 Answers 2

2
\$\begingroup\$

You may have them both selected somehow in your preferences so definitely check there first again. It is under

Edit -> Preferences -> External Tools -> External Script Editor

Set to MonoDevelop or Browse.

If they both aren't set and it's still trying to open both, other solutions include opening up VS while you are working so that it isn't taking longer to load which you are saying leads to MD opening instead. Another solution would be reinstalling Unity because sometimes it gets messed up if VS is installed after Unity. Here are some places you can try for more information. Unity Answers & Unity Forums

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the input @n_palum. I only have Visual Studio selected in the preferences. I have previously tried opening VS prior to selecting any scripts inside the unity editor, but Unity launches a second instance of VS in this case, and it doesn't always prevent Unity from opening Monodevelop. I am considering a full re-installation of both Unity and VS, however I reinstalled Unity previously whilst resolving an unrelated issue and this problem was not resolved as a result of doing so at that point, so I'm reluctant to do it all again until I've exhausted any other possible alternatives. \$\endgroup\$ Jan 27, 2017 at 14:21
  • \$\begingroup\$ Thanks for the links also, I dug through those pages for any similar issues prior to posting, if I don't have any luck soon I'll consider re-posting the question above in Unitys' forum to see if I can get any additional input there. \$\endgroup\$ Jan 27, 2017 at 14:24
  • \$\begingroup\$ Sorry nothing seems to be working. The last thing I can see that others recommend is the thing you want to avoid doing which is renaming the file extension of MonoDevelop which seems to me would do the trick although it does seem like a pain to not have access as easy. It may just be an issue with the newest version of Unity, or it may just be that there are a lot of things or extensions enabled in VS which could be slowing it down. If you can find anything that is unnecessary and making it harder to open that may help it too. \$\endgroup\$
    – n_plum
    Jan 27, 2017 at 14:31
-1
\$\begingroup\$

I suggest a simple solution: rename MonoDevelop.exe to MonoDevelop.exe.stop

have fun.

\$\endgroup\$
4
  • \$\begingroup\$ Have you tried this? Wouldn't this just give an error? \$\endgroup\$ Nov 9, 2017 at 12:17
  • \$\begingroup\$ I've tried because I had same problem. It work with no errors. ps.: why -1? because it is free of charge? \$\endgroup\$
    – Valentino
    Nov 9, 2017 at 12:38
  • 1
    \$\begingroup\$ I didn't give you a downvote and I don't know why someone did. I just asked for clarification. (Downvotes are at the discretion of the person but you're right, some explanation would be nice.) \$\endgroup\$ Nov 9, 2017 at 13:06
  • \$\begingroup\$ I already guessed that you are not the one who "pressed the down arrow/triangle" :)). Anyway I noticed a side-effect if you let set on "Editor attaching" check-box. Windows - in my case, while he wait to open MVS - open c# file in Notepad. I think there is smth in my register settings. I'm to lazy to take a look in my register..., for now. So I set that check-box unchecked. \$\endgroup\$
    – Valentino
    Nov 10, 2017 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .