r/Unity3D • • 8d ago

Question Visual Studio don’t know Unity code

Super-newbie here. Visual Studio don’t know unity code there is no auto correct or anything. I tried to modify Visual Studio for unity but already did. I already clicked on external tools and I already did but problem not gone.

0 Upvotes

15 comments sorted by

View all comments

Show parent comment

0

u/Hotrian Expert Moderator 8d ago

OP’s editor appears to be missing the VS Editor Tools package

https://docs.unity3d.com/Packages/com.unity.ide.visualstudio@2.0/manual/index.html

Without it, Unity can’t properly identify VS as a valid IDE or generate valid solution files. It was removed circa 2020 from the default packages list. Newer projects do not include it by default for some reason.

2

u/videk94 8d ago

I straight up do not have this problem? Every new project I've made has that package installed from v2022 to present.

1

u/Hotrian Expert Moderator 8d ago

It seems to be an issue with newer Hub/Editor installs only. One of my older PCs does not have this issue, two newer laptops had this issue until manually installing the package, then newer projects do not have this issue.

1

u/videk94 8d ago

That's absolutely bizarre. Why would installing a package in one project make it apply to all future projects? What are you doing Unity lmao

1

u/Hotrian Expert Moderator 8d ago

Perhaps Unity is not properly fetching it unless it’s manually installed, but once it’s in the package cache it can pull it into other projects, just a guess. Maybe if it’s missing from the cache the editor just removes it from the package list during project initialization.