I’m having an issue with Visual Studio 2019 and Unity 2020.3.2f1. I’m having an issue where certain using statements are not being recognized by VS. Here’s what I mean:
The weird thing is that I have used these exact same namespaces in other projects with the exact same version of unity and VS with no errors whatsoever. The difference is that I cloned this project from a repo. So far one other person working on the same project is having the same issue, and we have not been able to find a solution yet.
It hasn’t been a real problem yet, because the errors have only been in Visual Studio. When I save my files and Unity compiles them, everything works fine. The reason I am looking into this more now is because I’ve been trying to use an SDK package that I downloaded through the NuGet manager in VS, and I am having a similar problem. I was able to work around that by including the .dll files for the SDK into the project’s Plug-In folder, but there are still some things that aren’t working quite right.
I want to get this figured out, because I want to verify whether or not the same issue is at the source of both problems. I also would really like to be able to use IntelliSense for these packages, since not being able to has been a bit of a pain. I haven’t found anything helpful yet online. I have tried deleting my Library folder and having it reload when I start the project, but that has only given me more issues where certain .dll files don’t load right. Any ideas?
Thank you, Kurt. You’ve answered several of my questions on these forums over the past couple months, and I want you to know that I appreciate that you take the time to do that.
Unfortunately, none of the those fixes worked. Actually, I had not tried using VS Code yet, which I was told would solve the problem by someone working on the same project. I just forgot to try it until I saw your post. Unfortunately, all of the same error messages were present in VS Code.
In case anyone else with this problem finds this thread, I found the solution that worked for me. Apparently, the name of the repo that I cloned the project from used special characters (spaces), and those special characters in the repo folder name made it so none of the Unity packages were being recognized in Visual Studio. Thankfully someone else on the project figured it out.
All I did to fix it was rename the repo folder on my computer so that it didn’t have any special characters and add the project back into UnityHub. When I opened it, everything worked!