Home > database >  Openin unity script in visual studio does not work
Openin unity script in visual studio does not work

Time:04-14

I'm having issues to get the latest installment of Unity to work along with it's recommended visual studio 2019. I have a fresh instalation of both of them, done by using the unity hub installer. I create a new project, and make a vanilla c# script and try to open it with visual studio. Visual studio opens, yet there is no project opened, no file shown, not even the project browser pops up.

I have googled a bit and the only recommended sugestion I can find is about making sure that the unity package manager has the Visual Studio package installed which it does have, to the latest version. I don't know what else to do. enter image description here

CodePudding user response:

I managed to figure out my answer. It seems that what I needed to do was to go into Unity -> Edit -> Preferences -> External tools and select Visual Studio 2019 as my code editor. Then make sure that the Generate csproj file was checked. It seems for some unknown reason that unity does not have this option enabled by default, even though I specified in the Unity Hub installer that I want Visual Studio to be my editor, and I would have expected that all the configurations would have been done automatically.

CodePudding user response:

  1. Unity and VS versions do not match, try changing the VS version (Unity Editor->Edit->Preferences->External Tools->External Script Editor);

  2. Delete the ".vs" folder in the project (this folder is hidden by default, you need to open the hidden files to see it. This folder is boldly deleted, and VS will automatically create it after deletion).

  3. Delete the "Assembly-CSharp.csproj", "Assembly-CSharp-Editor.csproj" and ".sln" files. (Boldly delete, after deleting, VS will automatically create)

  • Related