Selective Projects Loading using Solution Filter in Visual Studio

Selective Projects Loading using Solution Filter in Visual Studio

Solution Filter in Visual Studio allows a faster load of the solution with selective projects. When we are working on a large solution with several projects, we may not work with all the projects together. Sometimes, specific developers only focus on a set of projects. Solution Filter in Visual Studio allows us to select only the required projects and help in faster load and build.

Solution Filter in Visual Studio

Save as Solution Filter” in Visual Studio allows you to save selective projects as filtered and load it later locally.

Consider you have a solution with several project, and out of them, as a developer you don’t work on those project. Select those project; and choose Unload Project from the Context Menu.

When the projects are unloaded, you can see the number of working projects changed. In this case; Working Projects are now 5 out of 8. You can show and hide the unloaded project by selecting the “Show Unloaded Project.”

When the projects are selected, and you are good to go, save them as “Save as Solution Filter” with a name. That will keep the solution chosen as .slnf ( Solution Filtered) file.

If you open and check what inside the “.Slnf” file; it just holde the reference of the actual solution with the selected project.

{
"solution": {
"path": "ConsoleApp5.sln",
"projects": [
"App1\App1\App1.csproj",
"ClassLibrary1\ClassLibrary1.csproj",
"ConsoleApp1\ConsoleApp1.csproj",
"ConsoleApp5\ConsoleApp5.csproj",
"WebApplication1\WebApplication1.csproj"
]
}
}

To Summerize, Solution Filter in Visual Studio allows us to select only the required projects and help in faster load and build. Please select the projects which are not necessary and unload them. Then save the solution as “Filtered Solution.” Open the “.Snlf” file to work with the selected project. Filtered solutions referred and keep in your local file system and won’t impact other developers and actual solution files.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.