- Home /
Unable to integrate Visual Studio
I am using Unity 2019.4.2. and Visual Studio 2022 Professional. I have already selected VS as the script editor with the editor attaching box checked under Edit > Preferences, and the .csproj and .sln files generate just fine. I also have VS tools for Unity Game Development installed. However, when I open my Unity project in Visual Studio (either directly from the .sln or by opening scripts or C# projects from the Unity editor), VS doesn't seem to "know" it's looking at a Unity project and I am unable to use any of the dev tools for Unity. I got a warning that the project was not built with the VS tools for Unity, but I'm not sure how to fix that since I've had the tools installed the whole time. I have re-generated the project files many times to no avail.,I am using Unity 2019.4.2f1. When I try to add modules to my installation, the only option under "Dev Tools" is "Visual Studio Community 2019;" however, I am using Visual Studio 2022. So even though all the necessary tools are installed for Visual Studio and I have set VS as the external script editor with editor attaching enabled, VS does not "know" that it is editing a Unity project when I open scripts in VS from Unity. How can I install the correct version of this plugin to edit my Unity project in VS?
I think VS Community 2019 is installed when you install a version of unity. You can select it during installation. Maybe you have 2 version of VS installed and your preferred editor is 2022, which is not linked to unity, because it says 2019. Maybe if you right click a .cs file in the explorer, and open with... select VS 2019 and check Always use this program. It's just an idea, based on an assumption, but its worth a try. I had some problems too, for me it was as simple as selecting the dev tools and regenerate the project files and i got it working. Maybe you could try reinstalling VS Code from the unity installation so you have a fresh setup. The integration is called Unity Intellisense i think, so maybe you can find some better information using that search term that might solve your problem.
Same thing Bro. I've met this few weeks ago, and downgraded to vs2019. But I still want umph of using 2022 when I need to do quite a bit of writing scripts.
Seems like some people get it to work by ticking Player Projects in Unity Preferences/External Tools. Others uninstalled VS2019, if I remember correctly that didn't worked for me, on another computer. source