【问题标题】:How to build all projects in the solution in specific configuration (as if you choose "Rebuild Solution")如何在特定配置中构建解决方案中的所有项目(就像您选择“重建解决方案”一样)
【发布时间】:2011-03-10 10:07:35
【问题描述】:

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

如何使用 msbuild 做到这一点?

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

我尝试了几个在 Internet 上找到的 msbuild 配置文件,但没有成功。

请帮我自动完成这样的任务,提前谢谢你!

【问题讨论】:

    标签: visual-studio-2010 msbuild


    【解决方案1】:
    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
    

    【讨论】:

    • 谢谢@Sergio,虽然我应该使用 Platform="Any CPU"。那里说“访问被拒绝注销我的dll”。我猜 msbuild 也应该以管理员身份运行
    • 是的,这太奇怪了:当你对一个 .csproj 文件运行 msbuild 时,它需要 AnyCPU,而当你对一个 .sln 文件运行它时,它需要 "Any CPU"...
    猜你喜欢
    • 2016-10-07
    • 1970-01-01
    • 2011-06-07
    • 1970-01-01
    • 2011-12-24
    • 2011-03-06
    • 1970-01-01
    • 2021-03-08
    • 1970-01-01
    相关资源
    最近更新 更多