Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load/unload multiple projects in a solution?

We have around 50 projects in our solution and that's a big time drain. The load/unload project feature is great help but the process is slow and tedious since there is so many projects and many dependencies between them.

I would like to have project 'templates' or 'presets'. For example, I want to work on project D and that means that projects A, B and C have to be loaded and everything else unloaded. If I want to work on project W that means that all projects from A to W have to be loaded.

Is this possible? The active 'template' would usually change few times per day.

like image 465
Nezreli Avatar asked Sep 23 '13 10:09

Nezreli


2 Answers

You have at least three options:

  • Use Solution Folders. These allow you to unload/reload projects in a group. Just create a Solution Folder, move a few projects there, and use the 'Unload Projects in Solution Folder' context menu item.
  • Use Macros. There are examples that do exactly that.
  • [Hacky/Speculation] The unloaded projects list is stored in the .suo file, so it might be convenient to create several .suo files and switch between the configurations by overwriting the original one.

Here is the original blog post from an ex-Microsoft employee having the same issues and solutions.

like image 97
Vladimir Sinenko Avatar answered Oct 17 '22 05:10

Vladimir Sinenko


Visual Studio 2019 has a new concept called "Solution Filter Files".

https://docs.microsoft.com/en-us/visualstudio/ide/filtered-solutions?view=vs-2019

You can right click on a solution after you've unloaded what you want and do "Save as solution filter". It creates a file which is a list of projects to INCLUDE in opening. So if a new project is added, I don't think it would be picked up.

Another important feature to note is the right click "Show unloaded projects" and the right click "Hide unloaded projects".

FYI - The file looks like this:

{
  "solution": {
    "path": "IvaraDotNet.sln",
    "projects": [
      "AssetManagement\\StaticLoad\\AssetManagementStaticLoad.vcxproj",
       ....
      "framework\\oqpersman\\oqpersman.vcxproj"
    ]
  }
}
like image 31
Derek Avatar answered Oct 17 '22 04:10

Derek