MSBuild:它是什么,什么时候需要? [英] MSBuild: What is it, and when do I need it?

查看:88
本文介绍了MSBuild:它是什么,什么时候需要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎错过了MsBuild 101的第一天.我发现自己在问:它是做什么的,它将取代什么,以及何时需要它?"因为我可以直接按F5并编译我的应用程序.

我最想念的是什么?

解决方案

MSBuild是可在Visual Studio世界中启用所有构建活动的构建平台.

一个更好,更实际的例子是指出

  1. .csproj文件(每个C#项目)都是msbuild文件

  2. 当您按下 F5 时,您基本上(过于简化)会调用msbuild.exe并传入您的.csproj文件.

MSBuild支持使击中F5 工作的所有功能.从创建"debug"或"release"文件夹,到将引用拖放到bin\目录,再调用CSC ...,以及介于两者之间的所有内容,MSBuild都为"这些提供了动力.

如果从构建中获得的只是 F5 给您的输出,那么您将了解MSBuild可能需要了解的所有信息.

但是,在大多数商业/实践开发方案中,有时会需要定制构建过程.最常见的方法是自动化构建过程(使用TeamBuild或某些本地系统).您可能还需要

  • 创建打包"部署
  • 链接到项目外部的另一个库,该库也处于活动状态 正在开发中
  • 将内部版本发布到FTP并发送电子邮件给客户,通知 他们的可用性.

使用统一且可扩展​​的构建平台(即MSBuild)使所有这些成为可能,同时仍是构建过程的一部分……使开发管道的构建"部分保持简单和包含. /p>

I seem to have missed Day 1 of MsBuild 101. I find myself asking "What does it do, what does it replace, and when do I need it?" since I can just hit F5 and compile my application.

What is the bigger picture I'm missing?

解决方案

MSBuild is the build platform that enables all build activity in the Visual Studio world.

A better, more practical example would be to state that

  1. The .csproj files (every C# project) are msbuild files

  2. When you hit F5, you basically (oversimplifying) call msbuild.exe and passing in your .csproj file.

MSBuild empowers all the things that make hitting F5 work. From creating the "debug" or "release" folder, to dropping references into the bin\ directory, to invoking CSC ... and everything in between ... MSBuild "powers" all that.

If all you will ever need from a build is the output that F5 gives you, then you know about all you probably need to know about MSBuild.

In most commercial/practical development scenarios, however, there will come a time where there is a need to customize the build process. The most common approach is automating the build process (using either TeamBuild or some homegrown system). You may also need to

  • create a "packaged" deployment
  • link to another library outside of your project that is also actively being developed
  • publish your build to an FTP and send an email to a customer notifying them of its availability.

The use of a unified and extensible build platform (ie MSBuild) is what makes all these these possible, while still being part of the build process ... keeping the "build" part of the development pipeline simple and contained.

这篇关于MSBuild:它是什么,什么时候需要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆