在解决方案资源管理器下 visual studio 解决方案中创建的文件夹未出现在源代码管理资源管理器中

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

我将我的 MVC 解决方案转换为分层架构。 为此,我在解决方案资源管理器的解决方案中添加了文件夹。一切正常,我的同事能够采用最新的解决方案,并且文件夹出现在解决方案资源管理器中。

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

可能我应该在 TFS 中创建文件夹结构 directly.But 现在我在创建文件夹后签入了很多更改,所以我认为这个选项不起作用。

请指教

应该是吧。根本原因是 Visual Studio 解决方案文件夹是 不是 真实文件夹。

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.

您可以在解决方案的 "project" 中创建真正的文件夹,但不能在解决方案本身中创建。关于这方面的详细信息,您可以参考以下问题:

  • Visual Studio Solutions Folder as real Folders
  • What is a solution folder in visual studio

Source Control Explorer 用于管理 TFVC 中的文件,解决方案文件夹中的文件将显示在 Source Control Explorer 中并与 .sln 文件处于同一级别,但是解决方案文件夹本身不会出现在源代码管理资源管理器中并保留文件夹结构。

至少在 Visual Studio 2019 年 C# 解决方案,您可以管理解决方案中的个人 forders。

为此,必须使用解决方案资源管理器中的 Switch View 按钮将视图切换到 Folder View

Look here for detailed description