I just installed Unity Hub and Unity 2020.3.2f1 and I already had Visual Studio Community 2019 16.9.3 installed.
I created a new Unity game, added a script, and when I double click it I get this error - it says the project type is unsupported:
It then tries to do a migration, which fails. If I try to use Visual Studio anyway, the project says it’s incompatible, and there’s no code completion or syntax highlighting:
I’ve spent hours googling this issue and trying every solution I’ve found, and nothing makes any difference.
Visual Studio Tools for Unity was already installed using Visual Studio Installer, but I tried uninstalling and reinstalling it, and it didn’t help.
In Edit - Preferences - External Tools, Visual Studio is selected, and I’ve tried browsing to the specific devenenv.exe, and nothing helped.
I’ve tried deleting and recreating the .csproj and .sln files. I’ve tried deleting the .vs folder. I’ve tried clicking Regenerate project files.
I’ve tried using Assets - Open C# Project.
I’ve tried uninstalling and reinstalling the Visual Studio Editor package.
At this point I’ve spent longer trying to figure this out than actually working on my game…
Don’t add files from Visual Studio. Create them from Unity. Visual Studio isn’t a necessary part of anything in Unity land. You can edit source files with whatever you care to.
Also, from Unity try Assets → Open C# project.
Also this standard stuff: This may help you with intellisense problems:
Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button
In my case, I have Visual Studio 2019 and Visual Studio 2022 both installed on my PC, and it only worked with Visual Studio 2022, never with Visual Studio 2019. Maybe the Visual Studio tools for Unity are not capable of being enabled in both version…
I had the same problem with VS 2022.
The thing that helped me was closing the project, deleting Library folder of the project and all csproj and sln files and reopening project to let it regenerate library and solution files