从批处理文件构建.net解决方案

发布于 2024-09-26 17:29:20 字数 83 浏览 0 评论 0原文

我有一个解决方案文件,其中包含 15 个使用一些第三方 dll 引用的项目。我希望能够从批处理文件构建解决方案。最好的方法是什么?

谢谢

I have a solution file comprising of 15 projects using a few third party dll references. I want to be able to build the solution from a batch file. What is the best way to do this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾城花音 2024-10-03 17:29:20

运行 msbuild - 例如:

msbuild MySolution.sln /p:Configuration=Release /p:Platform="Any CPU"

Run msbuild - for example:

msbuild MySolution.sln /p:Configuration=Release /p:Platform="Any CPU"
韬韬不绝 2024-10-03 17:29:20

最简单的方法之一是使用解决方案文件作为输入来执行 msbuild:

@echo off
call %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe path\to\solution.sln

如果这是在 Visual Studio 命令提示符中完成的,则可以跳过 msbuild.exe 的路径。

One of the simplest ways is to execute msbuild with the solution file as input:

@echo off
call %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe path\to\solution.sln

If this is done in a Visual Studio command prompt you can skip the path to msbuild.exe.

杀お生予夺 2024-10-03 17:29:20

一种开始方法是在 Visual Studio 中打开项目并选择“构建”|“构建”。重建解决方案。然后转到查看 |输出。在输出窗口中,在“显示选项自”下拉列表中选择“构建”。这将显示 Visual Studio 用于构建项目的命令。您可以将它们粘贴到批处理文件中,然后根据需要读取或修改它们。

如果您想维护应用程序的调试版本和发布版本,那么您将需要选择正确的配置,然后针对每个版本执行上述步骤。

One way to get started is to open the project in Visual Studio and select Build | Rebuild Solution. Then go to View | Output. In the output window select "Build" in the Show Options From dropdown. This will display the commands that Visual Studio is using to build the project. You can paste those into a batch file, and read or modify them as desired.

If you want to maintain both Debug and Release versions of your application, then you will want to select the correct configuration and then follow the above steps for each version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文