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

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

问题描述

我似乎错过了 MsBuild 101 的第一天.我发现自己在问它有什么作用,它取代了什么,我什么时候需要它?"因为我可以按 F5 并编译我的应用程序.

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 是支持 Visual Studio 世界中所有构建活动的构建平台.

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. .csproj 文件(每个 C# 项目)都是 msbuild 文件

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

当您点击 F5 时,您基本上(过于简单化)调用 msbuild.exe 并传入您的 .csproj 文件.

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

MSBuild 赋予了按 F5 工作的所有功能.从创建debug"或release"文件夹,到将引用放入bin目录,再到调用CSC ...以及介于两者之间的所有内容... MSBuild支持"所有这些.

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.

如果您从构建中需要的只是 F5 为您提供的输出,那么您可能需要了解有关 MSBuild 的所有信息.

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.

然而,在大多数商业/实际开发场景中,总有一天需要自定义构建过程.最常见的方法是自动化构建过程(使用 TeamBuild 或一些本土系统).您可能还需要

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

  • 创建打包"部署
  • 链接到您项目之外的另一个库,该库也正在活跃正在开发中
  • 将您的构建发布到 FTP 并向客户发送电子邮件通知他们的可用性.

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

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天全站免登陆