如何在特定配置中构建解决方案中的所有项目(就像您选择“重建解决方案”)

时间:2011-03-10 10:07:36

标签: visual-studio-2010 msbuild

我必须在特定配置(调试,发布)中构建解决方案中的所有项目,就像Visual Studio在选择“重建解决方案”时所做的那样。

我怎么能用msbuild做到这一点?

我希望二进制文件像往常一样出现在project \ bin \ debug | release文件夹中。

我尝试了几个在互联网上找到的msbuild配置文件但是徒劳无功。

请帮我自动完成这项任务,并提前感谢你!

1 个答案:

答案 0 :(得分:2)

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