63

In Visual Studio 2008, I can see all my project files in my Solution Explorer, and these files exist in an actual diectory.

However, if I add a file to that directory (let's say, an test.sqlite file in the App_Data folder, or say, images created by some other program), then these files do NOT appear in my Solution explorer, even if I click the refresh button.

How can I make files created by other applications appear in my Solution Explorer?

(so far, I have to create them somewhere else, then copy and paste them into the solution explorer itself, but there must be an easier way).


Edit:

Is there an advantage to this "fake solution view", i.e. I could have a file "test.sqlite" in my App_Data directory but in my solution, it could be appearing in my root directory. Coming from an Eclipse WYSIWYG Solution Explorer mindset, I don't see the advantage of having this extra virtual meta-information about the actual files in your directory. Is there a way you get an advantage out of this metaphor?

0

5 Answers 5

135

At the top of the solution explorer is a toggle button "Show All Files" this makes it include all files in the display even if they aren't included in the project. The icons for these will be grayed out a bit. Then just use the context menu to add these to the project.

5
  • 7
    Only works when a project is selected, not when you have selected the SLN itself. Jan 23, 2009 at 9:37
  • 3
    Right, you have to be inside a project. Either have the project selected, or any folder or file inside it. Jan 23, 2009 at 14:58
  • 1
    Right click + 'Include in project' Nov 23, 2015 at 13:42
  • To include "show all files" , go to project --> show all files and then right click on file --> include in project Jul 13, 2019 at 18:43
  • 1
    The time between occurrences is just long enough for me to forget how to fix this.
    – Yatrix
    Aug 29, 2019 at 14:48
9

On the solution, click the right mouse button and select 'Add existing item' and pick the file from the solution root directory. The Solution will now get a 'Solution Items' directory which contains your file. This directory is virtual, so it does not exist on disk.

However there is no feature like 'Show All Files' for a solution, this only works on projects.

0
1

I faced the same issue. I added new files and folders but the next time I took latest source code from SVN and then opened the project, it wont show the files which were added.

You can perform the following steps : 1. Solution explorer -> Show all files 2. Those files which are added recently will be displayed without the [@] icon on left side. Right click on the file and Select Include in the project 3. If you see the config file Web (Visual C# Project file (.csproj)) under Web folder, you will see the entries made for these new files. Check in this config file in your svn. 4. The next time you take repo checkout , it wont be an issue as the file details have been added into the configuration.

Hope this helps.

1

On the solution explorer the top rightest icon (Show all files), press it and you will see the file visible, then right click the file and choose: include this to project.

0

These days you can use the TF command line to do this.

  • Run the developer command prompt (from VS it's tools, command line, developer command prompt; or often you can find a shortcut under your start menu's Visual Studio Tools folder).
  • Navigate to the root folder for your project (i.e. the folder for which you want all content synced to source control)
  • run tf add * /recursive to select everything / push it all to the project. Other options documented in the tf docs.
  • use the Team Explorer pane's Pending Changes section to make any adjustments you may wish via the UI.
  • Check in your changes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.