In visual studio in the Solution Explorer , why I can't see some of the folders ?

On the hard disk I see all the folders and they are exist:

Audio,Prefabs,Scripts they are all under the folder FirstPersonCharacter

This three folders also exist in the editor in the Project:

But in the visual studio in the solution explorer this three folders are not exist.
I tried to refresh I tried to close and open the visual studio again, nothing helped.

No folders under FirstPersonCharacter
And if I’m trying to create new folder in the solution explorer under FirstPersonCharacter with the name Scripts I’m getting message it’s already exist.

1 Like

It only shows the files and folders that are included in your project by default. At the top of the solution explorer panel there should be a button that says “Show All Files” which will allow you to select grayed-out ones that exist but aren’t included yet, right click them, and say “Include in Project”.

If this is happening with Visual Studio when it’s linked to a Unity project, that’s pretty odd though- it should automatically include them. You may want to go into Unity’s Edit - > Preferences → External Tools and make sure the editor is attached, and that it’s pointing to the right default IDE. You also may need to open the project by using Assets → Open C# Project or by double clicking files, instead of opening VS manually.

10 Likes

Thanks you so much!!! these solutions works for me

Thank you!! Fixed it for me

The Assets → Open C# Project trick finally caused Unity to create an .sln file in the project folder. Thanks!

1 Like

Same here!

For people looking for answers on newer versions of Unity you may have to build your C# project.

First install windows build also in unity hub then select target platform to windows. and now you can see visual studio solution checkbox.

To do this go into File > Build Settings then select the option Create Visual Studio Solution. Then build that and your file explorer will ask you for which folder you want your visual studio solution to be placed into. Then Visual Studio should behave correctly.