从批处理文件构建.net解决方案
我有一个解决方案文件,其中包含 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
运行 msbuild - 例如:
Run msbuild - for example:
最简单的方法之一是使用解决方案文件作为输入来执行 msbuild:
如果这是在 Visual Studio 命令提示符中完成的,则可以跳过 msbuild.exe 的路径。
One of the simplest ways is to execute msbuild with the solution file as input:
If this is done in a Visual Studio command prompt you can skip the path to msbuild.exe.
一种开始方法是在 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.