MSBuild //Visual Studio生成系统

MSBuild是Visual Studio的生成系统,主要负责解释XML格式的项目文件并执行构建任务。项目文件中的关键元素包括Project(项目范围,包含DefaultTargets和Targets)、Property(用于存储可访问的属性信息)、Item(提供输入资源信息)、Target(表示原子任务,由实现ITask接口的.NET类执行)和Import(用于导入可重用项目文件)。MSBuild还使用特殊字符如%、$、@以及条件表达式来控制构建过程。
摘要由CSDN通过智能技术生成

以下部分引用自https://www.cnblogs.com/shanyou/p/3452938.html

MSBuild是Visual Studio的生成系统,可以简单的理解为Visual Studio的编译器,它能解释构造文件,执行构造动作,生成工程文件

MSBuild所解释的项目文件已XML架构定义,依靠XML文件来指示生成引擎生成哪些内容以及如何生成这些内容。

简单列一下MSBuild XML架构元素https://msdn.microsoft.com/zh-cn/library/5dy88c2e(v=vs.120).aspx元素

Element child Elements Attributes
Choose Element(MSBuild)

Otherwise

When

--
Import Element(MSBuild) --

Condition

Project

ImportGroup Element(MSBuild) Import Condition
Item Element(MSBuild) ItemMetaData

Condition

Exclude

Include

Remove

ItemDefinitionGroup Element(MSBuild) Item Condition
ItemGroup Element(MSBuild) Item Condition
ItemMetadata Element(MSBuild) Item Condition
OnError --

Condition

ExecuteTargets

OtherWise Element(MSBuild)

Choose

ItemGroup

PropertyGroup

--
Output Element(MSBuild) --

Condition

ItemName

PropertyName

TaskParameter

Parameter Element(MSBuild) --

Output

ParameterType

Required

ParameterGroup Element(MSBuild)

Parameter --
Project Element(MSBuild)

Choose

Import

ItemGroup

PorjectExtensions

PropertyGroup

Target

UsingTask

DefaultTargets

InitialTargets

ToolsVersion

TreatAsLocalProperty

xmlns

ProjectExtensions Element(MSBuild) -- --
Property Element(MSBuild) --

Condition

PropertyGroup Element(MSBuild) Property Condition
Target Element(MSBuild)

OnError

Task

AfterTargets

BeforeTargets

Condition

DependsOnTargets

Inputs

KeepDuplicateOutputs

Name

Outputs

Returns

Task Element(MSBuild) Output

Condition

ContinueOnError

Parameter

TaskBody Element(MSBuild) Data Evaluate
UsingTask Element(MSBuild)

ParameterGroup

TaksBody

AssemblyFile

AssemblyName

Condition

TaskFactory

TaskName

When Element(MSBuild)

Choose

ItemGroup

PropertyGroup

Condition
  • Project元素

这是每一个项目文件的最外层元素,它表示了一个项目的范围,不可或缺。

注意它的子元素Targets和属性DefaultTargets,有些人把它的DefaultTargets看成目标

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值