Sunday, June 14, 2015

How can I launch Visual Studio via a double-click on a C# script in Unity?


This is my first time using Unity and I am following the tutorial for the 2D RogueLike Game. Everythings seems to be working properly, apart that I cant get Visual Studio to launch, if I'm double click my c# scripts.


What I have tried so far:



  • Checked my preferences, that External Script Editor says "Visual Studio 2017"

  • Reinstalled Unity and Visual Studio.



Unity Version: 2019.3.0a2 Personal


Hope somebody can help me.


Additional information:



  • After double click, nothing seems to be happening, even my mouse doesnt show a load icon

  • When I create a new project, the bug (dont know if bug, or my fault) is still there.

  • I can open the .sln file from my project in Visual Studio. Visual Studio can even autocomplete unity based code then, before it was a "miscellaneous file" and didnt autocomplete code like for example "Transform" or "Rigidbody2D".



Answer



Open the Package Manager (Window -> Package Manager) and scroll down to Visual Studio Editor. In the lower right corner of the window there should be a button that says something like "Update to 1.0.11". Click that button.



Just to be on the safe side, do the same for Visual Studio Code Editor.


That resolved the issue for me. For some reason, having an outdated package causes Unity to just do nothing. No errors, warnings, or anything. But as soon as I updated I was able to launch Visual Studio by double clicking a script file.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...