Visual Studio Solutions Folder as real Folders

后端 未结 14 2283
盖世英雄少女心
盖世英雄少女心 2020-11-29 00:47

I have a Visual Studio Solution. Currently, it is an empty solution (=no projects) and I have added a few solution folders.

Solution Folders only seem to be \"virtua

相关标签:
14条回答
  • 2020-11-29 01:25

    Folder To Solution Folder By Cecilia Wirén - CeciliaSHARP

    Remove the hassle of adding several files to solution folder. Just use the context menu for the solution and just below the option of creating a new solution folder you now find 'Add Folder as Solution Folder'. This will create a solution folder with the same name as you selected and add the items inside of that folder to the solution folder. This will not move the files on disk.

    0 讨论(0)
  • 2020-11-29 01:29

    There is a workaround, that actually behaves as expected.

    1. Add a New or Existing Web Site to the Solution. (I usually create a new one.)
    2. Just make sure it's created inside your solution folder. (I sometimes even create a "link" to an external folder, e.g. 'Docs' or 'Marketing' on a network share. In that case it's ignored by Git of course.)
    3. Make sure to go to the "Project" settings or Configuration Manager to exclude this "Web Site" from Build and Deploy!

    Done. Now Solution Explorer will reflect any change in the file system and vice versa (including subfolders).

    I (miss)use it for specs, docs, PM and some DevOps scripts that are shared within the team. It's easy to choose, what to include in source control or not, and (if set up correctly) it doesn't conflict with build.

    I know the feature is not intended for that use case, but except for the maybe misleading "Project" icon I didn't find any shortages to that hack yet. And there still are use cases where the classical (virtual) Solution Folders that VS provides, fit in the picture. What do you think?

    0 讨论(0)
  • 2020-11-29 01:38

    No special setting. I don't think it's supported.

    You can create real folders in a "project" within the solution, but not in the solution itself.

    0 讨论(0)
  • 2020-11-29 01:38

    No, it's not supported. As you suspected, solution folders are simply virtual subentries in the .sln file, nothing to do with the file system.

    0 讨论(0)
  • 2020-11-29 01:38

    You can add real folders by choosing "Add new filter" for a Visual Studio project file. You can also do "Add new filter" under an existing folder. Once the folder is created, rename it and add source or header file or whichever suits your project. This is one way I know which lets us create real folders through the Visual Studio IDE.

    0 讨论(0)
  • 2020-11-29 01:38

    The folder created underneath the solution will be virtual as said. Maybe this might be called a workaround but you can physically create the folder on disk either before or when you add new item/project and Robert should be a sibling of your dad.

    ps- on closer look maybe i should explain "bob's your uncle" means your fine/sorted.

    0 讨论(0)
提交回复
热议问题