24

I am very new to Visual studio, so I am trying to learn the basics.

I have read so many articles but some are for 2012, some are for the non-web version, etc, but I seriously can't find a solution to such a simple task as this.

I am using Visual Studio Express 2012 for Web, and have created a "Blank Solution".

I end up with this view:

enter image description here

Now my goal is to add all my existing files and folders and have it shown in Visual Studio.

So, I have located my solution file on disk and copied all my files into the same folder:

enter image description here

Now, I know its possible to add single items into the view by right clicking and picking add item:

enter image description here

But I cant include folders here. I have tried to drag and drop, I have read guides about using the "Show all files" button, but apparently that does not exist for the Web version of Visual Studio 2012.

Could anyone please tell me what the proper way is to include all my files into the solution explorer?

corgrath
  • 11,673
  • 15
  • 68
  • 99
  • In older versions of VS Web Express, the folder structure was not supported (I guess it was considered a more advanced, "Professional" feature). Not sure about the latest version, but it might be that support just isn't there. – codingoutloud May 13 '13 at 20:26

6 Answers6

31

I just had this same problem in Visual Studio 2012 Ultimate. I know your question is about Web but maybe this will work for you too.

Assuming the files/folders you want to include are in your solution folder, from the Project menu toggle on "Show All Files", then you should see the files/folders in Solution Explorer. Select those you want to include, right click and choose "Include in Project".

Adrian Parker
  • 441
  • 3
  • 7
  • I have VS2012 ultimate, but this doesn't work for me. The option is there, but when I click on "include in project," nothing happens. If I turn of "show all files," the folder isn't included. What could be wrong? – Dan Nov 04 '13 at 19:37
  • Note that you have to do this for each file in a folder. A folder itself will be ignored, but included once one or more files within that folder is included. – Thomas N Feb 12 '14 at 07:35
  • This option would only be enabled when you point in the Solution Explorer at the project branch! – ajeh Apr 13 '16 at 14:50
3

A solution contains one or several projects and no solution-wide files (normally). Create a project, and then follow How do I add an existing directory tree to a project in Visual Studio? to add the files.

(It was a long time ago I did it this way, and with an earlier version of Visual Studio, so YMMV.)

Community
  • 1
  • 1
David Pettersson
  • 368
  • 2
  • 11
  • There isn't any similar to "blank projects". I would like to use Visual Studio for non-ASP development, meaning I should probably not be creating a project in that case? – corgrath Jan 27 '13 at 11:07
3

I think that the best way to do it is to simply drag&drop desired folders with files between file explorer and solution explorer in VS. I've just tested it and that works the best for me.

Pawel
  • 31
  • 1
2

You can place your files in the Solution folder and refresh the solution explorer :) It'll automatically add your files, I do it for 2010 and think it'll work for 2012 as well

  • try to restart the visual studio. – Iswanto San Jan 27 '13 at 09:18
  • Restart did not show my files, in the same folder as my solution-file. – corgrath Jan 27 '13 at 09:20
  • in VS2010 there is a refresh button on the top solution explorer, as I see in the picture 2012 has it as well – Hovhannes Babayan Jan 27 '13 at 09:25
  • 1
    Can you see it my screen shot? – corgrath Jan 27 '13 at 09:27
  • Yes :) http://stackoverflow.com/questions/12663280/add-an-already-existing-directory-to-a-directory-in-solution-explorer this is a good point, but as I can see for linked projects you can't do it by placing folders, I was doing it in web project, in this case you should add as it is written in this page – Hovhannes Babayan Jan 27 '13 at 09:29
  • This negates your link. Show all files button does apparently not exist for VS2012 web http://stackoverflow.com/questions/14383234/visual-studio-2012-show-all-files-button-missing – corgrath Jan 27 '13 at 09:31
  • Visual studio 2012: Your solution probably has one or more projects. Click on one of these, and observe that the bar in the solution explorer changes, and an icon with 2 arrows circling each other appears. This is the refresh button. It sadly still does not work for folders. I had to "Project -> Show all files" then manually add each file by right clicking and doing "Include in Project". The folders themselves were included whenever I manually added a file within the folder. – Thomas N Feb 12 '14 at 07:32
2

In solution Explorer top toggle,You can find few icons, Find Show all files and click on it.Navigate to the folder exactly matching the same address in your visual studio and you can see a folder which is newly added into your project,Which is displayed as a dotted folder and right click on it and include it into project.

Don't forget to convert the project into Web-Application.

Thanks.

0

I actually found the solution. So in solution explorer there is a button "Solutions and Folders" screenshot When you pressed it your project folder would be opened. You find the folder that you need to add, copy it (screenshot), return to project solution and past it

osynavets
  • 1,199
  • 1
  • 12
  • 22