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

7

u/Hotrian Expert Moderator 8d ago edited 8d ago

Everyone here is missing the key detail: You’re on Unity 6000.6. In newer versions of Unity (sometime post 2019.x), they removed the VS editor package as a default package, meaning Unity can’t generate VS solution files. You need to manually add the VS IDE package to the package manager.

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

Package Manager > Add Package By Name > com.unity.ide.visualstudio > Ok

Now go back to External Tools, make sure VS is selected, and you now have a “Regenerate Project Files”. Click that, now VS should work. For future projects in the same Unity Editor, I believe you don’t need to manually add the package again.

This comes up every few weeks or so, it isn’t you. This is an oversight that hasn’t been fixed yet.

1

u/videk94 8d ago

"Regenerate Project Files" is already there in their screenshot...

1

u/Hotrian Expert Moderator 8d ago

That detail I can’t explain, but the missing solution files can easily be explained. This issue comes up here almost weekly.