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?

Read more here: Source link