Andrew Florko
Andrew Florko

Reputation: 7750

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 !

Upvotes: 7

Views: 9616

Answers (1)

Sergio Rykov
Sergio Rykov

Reputation: 4286

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

Upvotes: 4

Related Questions