Visual Studio 2012 does not show folder has been created

13,172

Solution 1

The Visual Studio project does not parallel you filesystem. If you create a directory or add a file into a directory through Windows Explorer, it will not show up in Visual Studio. You must either create the file or folder inside Visual Studio or use the Add... dialog for the project to add existing files.

Solution 2

The simplest solution for me was to recopy the files/directories from the project folder and repaste them on the Visual Studio Solution Explorer panel.

That's it!

Visual Studio will automatically sync file explorer with the Visual Studio file system.

Solution 3

Yes, this is because Visual Studio needs all its resources explicitly listed in its project files. When you add a folder in VS, it creates it on disk and changes the project file - whereas if you've added it in Explorer, the project file won't have any information about it.

The simplest solution I find is usually to rename them in explorer, add them in Visual Studio, then move the content from the original folder into the new one.

Alternatively, you could edit the project files directly, but that's slightly more advanced and dangerous. (It's not really that hard, and probably worth experimenting with if you've committed the "known good" project file.)

Solution 4

Folders should show on Visual Studio as well, sometimes they are hidden, hence when you try to create the folder with the same name it will not allow you to do that. So all you need to see all the folders is go to solution explorer and click on show all files button on top of the window, then you will see the hidden folders which are in different colour, right click on folder and select include in project.

Solution 5

Try using Show All Files in the Project Explorer and then right click the folders to add to the project.

Did you create the folders in Windows Explorer? If not maybe your project file get corrupted

Share:
13,172
Nguyen Ngoc Hoang
Author by

Nguyen Ngoc Hoang

Updated on June 15, 2022

Comments

  • Nguyen Ngoc Hoang
    Nguyen Ngoc Hoang almost 2 years

    I use Microsoft Visual Studio 2012. I first opened my ASP.NET project, then I created some folder as Pages, Views, Sources. But the second I open the project, Visual Studio doesn't show those folders. I cannot view them. If I make a new folder with the same name above, the IDE renders a message that the folder already exists.

    Can you help me! Thank you very much!

  • JoshYates1980
    JoshYates1980 almost 10 years
    This is annoying that VS will feel left out and hide the files if I use windows explorer to copy and paste....but I understand why this is the process.
  • Ray Toal
    Ray Toal almost 8 years
    Saved my life. Will award +100 when the system lets me.
  • rustyengineer
    rustyengineer almost 8 years
    OMG!! Thank you so much. I committed and pushed codes from my desktop, but after git pull in my laptop, one folder is not added to the VS solution explorer. I was so frustrated trying to fix it. Thank you!!!!
  • srinced
    srinced over 7 years
    this is not the case at least for vs2015 and vs2017, folders are synced, please check my answer below.
  • Admin
    Admin over 4 years
    @Mr.AF, good advice, but unfortunately I don't have enough rep yet..