5

I converted my MVC solution to layered architecture . For this I added folders in my solution in Solution Explorer. Everything is working good, my colleagues are able to take the latest of solution and the folders are appearing in solution explorer.

The issue is I am not able to see the folder structure in TFS(in Source Control Explorer.)

Probably I should have create the folder structure in TFS directly.But now I have lot of changes checked in since I created the folder, so I think this option will not work.

Please Advice.

winterishere
  • 350
  • 1
  • 5
  • 21
  • Didn't you creatd solution folders instead of standard folders? Solution folders are virtual just for solution explorer. – TcKs Dec 26 '17 at 16:43
  • yeah its solution folders but shouldn't it show under tfs? – winterishere Dec 26 '17 at 16:46
  • Are the new folders empty? If so, TFS doesn't show these as pending changes to he checked in as default. https://stackoverflow.com/questions/642695/why-do-empty-folders-disappear-when-adding-visual-studio-solution-to-tfs – Mark Rawson Dec 26 '17 at 16:48
  • @MarkRawson thanks for the link, it's very informative. But in my case folders are not empty, i added several projects inside the folder then checked in the solution. – winterishere Dec 26 '17 at 17:02
  • I don't see any reason why should be visible in TFS. They are declared in *.sln file. One project can be part of more solutions. It's imposible to show that correctly in these cases. – TcKs Dec 26 '17 at 17:32
  • @TcKs I am new to layered architecture. So what you are saying is that the folders need not be visible in tfs repository. If that's the case then i think i should be good. – winterishere Dec 26 '17 at 18:22
  • Imagine scenario, where you have 10 projects and 5 solutions in relation N:M. Each solution will have same solution folders but with different projects in. How do you want to expose that without duplication of projects? TFS shows file system folders, not virtual folders added by visual studio plugins (solution explorer is kind-of plugin). You can also write your own plugin to add another kind of folders or groups in solution explorer. There is also nested items i.e. MyPage.aspx & MyPage.aspx.cs. – TcKs Dec 27 '17 at 05:19
  • @TcKsThanks for this detailed explanation. There's not much items online clarifying this. Hope this will help someone else too. – winterishere Dec 27 '17 at 19:09
  • Does this answer your question? [What is a solution folder in Visual Studio?](https://stackoverflow.com/questions/374081/what-is-a-solution-folder-in-visual-studio) – Michael Freidgeim Dec 11 '20 at 23:57

2 Answers2

11

It's supposed to be it. The root cause is Visual Studio solutions Folder are not real Folders.

Solution Folders only seem to be "virtual folders", because they are not really created in the Filesystem and files inside solution folders are just sitting in the same folder as the .sln file.

You can create real folders in a "project" within the solution, but not in the solution itself. Details about this area, you could refer below questions:

Source Control Explorer is used to manage files in TFVC, the files in the solution folder will shown up in the source control explorer and be the same level with .sln file, however the solution folders itself will not appearing in source control explorer and keep the folder structure.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
0

At least for C# solutions in Visual Studio 2019 you can manage individual forders in the solution.

To do this the view has to be switched to Folder View using the Switch View button in Solution Explorer.

enter image description here

Look here for detailed description

marsh-wiggle
  • 2,508
  • 3
  • 35
  • 52