Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build all projects in the solution in specific configuration (as if you choose "Rebuild Solution")

I have to build all projects in solution in specific configuration (debug, release) just the same way Visual Studio does when you choose "Rebuild Solution".

How can I do that with msbuild?

I expect that binaries should appear just in project\bin\debug|release folders as usual.

I tried several msbuild configuration files I found in Internet but in vain.

Please help me to automate such a task and thank you in advance !

like image 742
Andrew Florko Avatar asked Mar 10 '11 10:03

Andrew Florko


People also ask

What is the difference between build Solution and rebuild solution?

Build Solution - compiles code files (dll and exe) that have changed. Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.

How do I rebuild all in Visual Studio?

To build, rebuild, or clean an entire solutionChoose Build All to compile the files and components within the project that have changed since the most recent build. Choose Rebuild All to "clean" the solution and then builds all project files and components. Choose Clean All to delete any intermediate and output files.


1 Answers

MSBuild.exe sample.sln /t:Rebuild /p:Configuration=Release;Platform=AnyCPU
MSBuild.exe sample.sln /t:Build /p:Configuration=Release;Platform=AnyCPU
MSBuild.exe sample.sln /t:Clean /p:Configuration=Release;Platform=AnyCPU
like image 179
Sergio Rykov Avatar answered Oct 14 '22 02:10

Sergio Rykov