How can I unload Visual Studio projects via batch file/developer command prompt?

57 Views Asked by At

When I open this solution file for the projects I'm working on, all projects in the solution are loaded to be compiled, but there are some projects that I don't need to compile at this time, so I unload them manually, one by one. I have to do this everytime I open the solution file.

I'm using Visual Studio 2017, and AFAIK it's only possible to open a filtered solution if you are using Visual Studio 2019 or higher.

I wanted to create some sort of batch file to have these projects which I don't need unloaded faster, so that I wouldn't need to unload them by manually clicking one by one everytime I open the solution.

I can't remove those unwated projects from the solution because the solution file is versioned and it would not be handy to change it everytime.

I tried to find anything on unloading projects via Developer Command Prompt, but to no avail.

I couldn't find anything on VS extensions to help with this issue.

I also tried asking ChatGPT, it suggested that I tried this syntax:

msbuild YourSolution.sln /t:UnloadProject /p:ProjectName=YourProjectName

But this command actually made the Developer Command Prompt try to compile all projects and returned this error for each one of them (I already checked the solution path and projects):

error msb4057: the target does not exist in the project
0

There are 0 best solutions below