Folders created in visual studio solution under solution explorer not appearing in source control explorer
Asked Answered
B

3

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.

Bonny answered 26/12, 2017 at 16:41 Comment(9)
Didn't you creatd solution folders instead of standard folders? Solution folders are virtual just for solution explorer.Judaea
yeah its solution folders but shouldn't it show under tfs?Bonny
Are the new folders empty? If so, TFS doesn't show these as pending changes to he checked in as default. #643195Workingwoman
@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.Bonny
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.Judaea
@Judaea 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.Bonny
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.Judaea
@TcKsThanks for this detailed explanation. There's not much items online clarifying this. Hope this will help someone else too.Bonny
Does this answer your question? What is a solution folder in Visual Studio?Eyesore
S
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.

Streptokinase answered 27/12, 2017 at 9:58 Comment(0)
W
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

Willing answered 10/4, 2021 at 10:58 Comment(1)
This is a "folder view" and shows the folders on disk. The virtual folders in the *.sln file are shown when you select the "solution view" again. It is easy to confuse these two concepts, but you could see this explained in the original answer.Benue
L
0

I'm using VS2022 and what worked for me was to click the "Show All Files" at the top in the solution explorer:

enter image description here

That will make them visible but they are still not part of the solution. Btw, sometimes I need to reload the solution or Visual Studio to make the button work.

After you see them, right click and select "Include in Project":

enter image description here

Then just click the first button again and you should see only what's in the project: enter image description here

Lemar answered 27/10, 2024 at 0:28 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.