0

Issue

I get 'All Files are up to date' with TFS's 'get latest' (Both at the parent directory and solution level) when they clearly aren't (there are a few folders that others have checked in that I am not getting). I can see they exist locally in the appropriate location (which is most certainly mapped) but I absolutely can not get them added to solution explorer.

I'm in VS 2013.

What I've Tried

1) Drag and drop the folders from the file explorer. Doesn't work - VS apparently doesn't allow this.

2) Right click the parent folder in Solution Explorer click 'Add -> existing item'. Apparently you can't add an entire folder, so adding individually is no good as there are over 2000 items in all the sub-directories.

3) Right click, 'Source Control -> Get Specific Version' check both boxes regarding overwriting.

4) Repeat step 3, but first delete folder in the file explorer. The files get re-added to file explorer, but not Solution Explorer.

5) I found this Visual Studio Solution Explorer not showing files and folders and tried it, also to no avail.

6) Multiple combinations of all the above steps, restarting VS, etc.

Thanks!

EDIT 2/24/2016

Adding this here as a reference diagram for my comment in response to the answer, as I can't use new lines in a comment.

File Structure:

FooFolder |-foo.txt |-BarFolder |--bar.txt

In the above example, you still have to ctrl+click through foo.txt and bar.txt separately, since select all would include the folders and disallow add to solution.

Community
  • 1
  • 1
Jake Wood
  • 97
  • 10
  • 1
    Have you tried doing a Get Specific on the project file and then reloading the project? Have you tried the Show All Files in the Solution Explorer? if that shows the folders you miss, right click the folder and choose Include in Project – Wouter de Kort Feb 22 '16 at 20:33
  • Show All files worked. If you want to put that as an answer, I'd be happy to mark it as an answer :) – Jake Wood Feb 22 '16 at 21:09
  • Just out of curiosity though, is there a faster way to do this? Or should I just make 'Show all files' part of my workflow due to all the bugs I've been hearing about? – Jake Wood Feb 22 '16 at 21:10
  • I usually Show all files to avoid this type of confusion. I'm not aware of a faster way to add files to a project. – chief7 Feb 22 '16 at 21:18

1 Answers1

0

If you see the "missing" files on your local file system after a Get Latest then they are correctly in Source Control. To add the files to your project you need to Show All Files then you can right click each and Include in Project:

enter image description here

enter image description here

To add files to the solution right click and choose Add | Existing Item:

enter image description here

chief7
  • 14,263
  • 14
  • 47
  • 80
  • Do you know of any way to automate the 'include in project' though? If you have something like it's a problem. If you select all files, and folders are included in that selection, the `include in project` isn't available. Therefore, if you have thousands of files, but in many different folders (as was in my case) it's still quite time consuming, because you can only add contiguous blocks of files (i.e. no folders in between). – Jake Wood Feb 24 '16 at 20:14
  • Behind the scenes VS is just adding the file to the project file (.csproj/.vbproj). You could write a script to read the directory and add all missing files to the project file. – chief7 Feb 24 '16 at 20:17
  • True. If I write the script, I'll post it here an hopefully help someone else. Seems a little silly that this is such an issue. – Jake Wood Feb 24 '16 at 20:23