简体   繁体   中英

How to set Solution Configuration Build in MSBuild command-line

I am trying to build my solution using MSBuild in the Command-Line instead of Visual Studio.

So, I have a Solution Configuration Build called "Installer - QA" which will generate the .exe file. However this solution configuration does not have a project configuration with the same name, so it is building all the projects.

msbuild solutionName.sln /p:Configuration="Installer - QA"

From what I understood this Configuration property sets the Project Configuration instead of Solution Configuration, then my project filter does not work.

It's funny because in Visual Studio works, is there a way to know how Visual Studio does?

The solution I've found so far it's to build using "devenv.exe" as the following:

devenv solutionName.sln /rebuild "Installer - QA"

You will need to add the path to devenv.exe in the PATH environmental variable (eg "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE").

The only drawback I see in this solution is the need to install Visual Studio IDE at the remote server.

This post helped me to figure out this answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM