MSBuild 词汇表MSBuild glossary

这些术语用于描述 Microsoft 生成引擎 (MSBuild) 及其组件。These terms are used to describe the Microsoft Build Engine (MSBuild) and its components.

词汇表Glossary

AssemblyFoldersExAssemblyFoldersEx
注册表位置,第三方供应商将其支持的每个框架版本的路径存储在此,设计时解析可在此处查找参考程序集。A registry location where third party vendors store paths for each version of the framework that they support where design time resolution can look to find reference assemblies.

批处理batching
批处理是指根据项元数据,将项划分为不同类别(称为批次 ),然后使用每个批次运行目标或任务。Batching means dividing items into different categories known as batches, based on item metadata, and then running a target or task one time by using each batch. 批处理相当于 MSBuild for 循环构造。Batching is the MSBuild equivalent of the for--loop construct. 有关详细信息,请参阅批处理For more information, see Batching.

生成范围build-scope
生成范围描述全局属性等 MSBuild 对象,该对象对项目和在多项目生成中创建的任何子项目都可见。Build-scope describes an MSBuild object, for example, a global property, that is potentially visible to a project and to any child projects that are created in a multi-project build.

子项目child project
请参阅项目,子项目See project, child.

条件condition
可根据条件定义多个 MSBuild 元素;也就是说,元素中会出现 Condition 属性。Many MSBuild elements can be defined conditionally; that is, the Condition attribute appears in the element. 除非条件的计算结果为 true,否则会忽略条件元素的内容。The contents of conditional elements are ignored unless the condition evaluates to true. 有关详细信息,请参阅条件For more information, see Conditions.

定义,项definition, item
请参阅项定义See item definition.

发出项emit item
在生成的执行阶段,可通过具有 Output 子元素(具有 ItemName 属性)的任务来创建或修改项。During the execution phase of a build, items can be created or modified by tasks that have child Output elements that have the ItemName attribute. 该任务会“发出”新项。The task is said to "emit" the new items.

发出属性emit property
在生成的执行阶段,可通过具有 Output 子元素(具有 PropertyName 属性)的任务来创建或修改属性。During the execution phase of a build, properties can be created or modified by tasks that have child Output elements that have the PropertyName attribute. 该任务会“发出”新属性。The task is said to "emit" the new property.

评估阶段evaluation phase
评估是项目生成的第一个阶段。Evaluation is the first phase of a project build. 所有属性和项按其在项目中的显示顺序进行评估。All properties and items are evaluated in the order in which they appear in the project. 对于导入的项目,其出现在项目中时才进行评估。Imported projects are evaluated as they are encountered in the project. 在执行阶段前不会运行目标和任务,且评估期间将忽略它们声明或发出的任何属性或项。Targets and tasks are not run until the execution phase, and any properties or items they would declare or emit are ignored during evaluation.

执行阶段execution phase
执行是项目生成的第二个阶段。Execution is the second phase of a project build. 会生成所选目标并运行任务。Selected targets are built and tasks are run. 与其评估值相比,属性和项可进行创建或修改。Properties and items can be created or modified compared to their evaluation values.

函数,属性function, property
请参阅属性函数See property function.

函数,项function, item
请参阅项函数。See item function.

item
项是生成系统的输入,并基于其元素名组成不同的项类型。Items are inputs into the build system, and are grouped into item types based on their element names. 项通常表示文件。Items typically represent files. 由于项根据其所属项类型命名,因此术语项值可互换使用。Because items are named by the item type they belong to, the terms item and item value can be used interchangeably. 有关详细信息,请参阅For more information, see Items.

项定义item definition
项定义组包含将默认元数据添加到任何项类型的项定义。Item definition groups contain item definitions that add default metadata to any item type. 与已知元数据一样,默认元数据与指定项类型的所有项关联。Like well-known metadata, the default metadata is associated with all items of the specified item type. 可在项定义中显式重写默认元数据。Default metadata can be explicitly overridden in an item definition. 有关详细信息,请参阅项定义For more information, see Item definitions.

项函数item function
项函数可获取项目中项的相关信息。Item functions get information about the items in the project. 这些函数简化 Distinct() 项的获取过程,并且比循环遍历项的速度更快。These functions simplify getting Distinct() items and are faster than looping through the items. 有的函数可操纵项路径和字符串。There are functions to manipulate item paths and strings. 有关详细信息,请参阅项函数For more information, see Item functions.

项元数据item metadata
请参阅元数据,项See metadata, item.

项类型item type
项类型是项的命名列表,可用作任务参数。Item types are named lists of items that can be used as parameters for tasks. 任务使用项值来执行生成过程。The tasks use the item values to perform the steps of the build process. 有关详细信息,请参阅For more information, see Items.

元数据,项metadata, item
项元数据是与项关联的名称/值对集合。Item metadata is a collection of name-value pairs that is associated with an item. 元数据为项提供描述性信息,且除已知元数据外,其他元数据是可选的。Metadata provides descriptive information for the item and is optional, except for well-known metadata. 有关详细信息,请参阅For more information, see Items.

元数据,已知metadata, well-known
已知元数据是通过使用预定义值初始化的只读项元数据。Well-known metadata is read-only item metadata that is initialized by using a predefined value. 已知元数据为引用文件的项提供描述性信息。Well-known metadata provides descriptive information for an item that references a file. 例如,名为 FullPath 的已知元数据的值是所引用文件的完整路径。For example, the value of the well-known metadata named FullPath is the full path of the referenced file. 有关详细信息,请参阅For more information, see Items.

多目标multitargeting
应用程序或程序集项目从 MSBuild 和 Visual Studio 瞄准多个不同 CLR 和框架的能力。The ability for an application or assembly project to target many different CLR's and frameworks from MSBuild and from Visual Studio.

配置文件profile
完整框架的子集。A subset of the full framework. 用于最大程度减少需下载到计算机的量。This is used to minimize the amount that needs to be downloaded to a machine.

项目文件project file
项目文件包含控制生成的 MSBuild 脚本。A project file contains the MSBuild script that controls the build. 项目文件通常具有以“proj”结尾的文件扩展名(如 .csproj 或 .vbproj) 。Project files typically have a file extension that ends with proj, such as .csproj or .vbproj. 项目文件可能会导入属性文件和目标文件。Project files may import property files and target files.

属性property
属性是用来控制生成过程的键值对。A property is a key-value pair that is used to control the build process. 详情请参阅 MSBuild 属性For more information, see MSBuild properties.

属性,环境property, environment
环境属性是自动初始化为同名系统环境变量值的属性。An environment property is a property that is automatically initialized to the value of a system environment variable that has the same name. 详情请参阅 MSBuild 属性For more information, see MSBuild properties.

属性文件property file
属性文件是包含大部分指导生成的属性组和项组的项目文件。A property file is a project file that contains mostly property groups and item groups that guide the build. 按照约定,其文件扩展名为 .props 。By convention, It has the file extension .props. 通常在关联的项目文件的开头导入属性文件。Property files are typically imported at the beginning of associated project files.

属性,函数property, function
属性函数是可用于评估 MSBuild 脚本的系统属性或方法。A property function is a system property or method that can be used to evaluate MSBuild scripts. 可使用属性方法读取系统时间、比较字符串、匹配正则表达式以及执行其他操作。Property methods can be used to read the system time, compare strings, match regular expressions, and perform other actions. 有关详细信息,请参阅属性函数For more information, see Property functions.

属性函数,嵌套property function, nested
可将属性函数组合成更复杂的函数。Property functions may be combined to form more complex functions. 例如,应用于对象的For example,

$([MSBuild]::BitwiseAnd(32, $([System.IO.File]::GetAttributes(tempFile))))

有关详细信息,请参阅属性函数For more information, see Property functions.

属性,全局property, global
全局属性是用来控制生成过程的键值对。A global property is a key-value pair that is used to control the build process. 可在命令提示符下或使用 MSBuild 任务Properties 特性设置全局属性,并且在生成的评估阶段无法修改该属性。Global properties are set at a command prompt, or by using the Properties attribute of an MSBuild task, and cannot be modified during the evaluation phase of a build. 详情请参阅 MSBuild 属性For more information, see MSBuild properties.

属性,本地property, local
本地属性是用来控制生成过程的键值对。A local property is a key-value pair that is used to control the build process. 此术语仅用于区分全局属性以外的属性。This term is only used to distinguish a property that is not a global property.

属性,注册表property, registry
注册表属性具有使用特殊语法设置的值,该语法可读取系统注册表子项的值。A registry property has a value that is set by using a special syntax that reads the value of a system registry subkey. 详情请参阅 MSBuild 属性For more information, see MSBuild properties.

属性,保留property, reserved
保留属性是用来控制生成过程的键值对。A reserved property is a key-value pair that is used to control the build process. 保留属性将自动初始化为预定义的值。Reserved properties are automatically initialized to predefined values. 详情请参阅 MSBuild 属性For more information, see MSBuild properties.

项目范围project-scope
项目范围描述本地属性等 MSBuild 对象,仅在包含的项目文件中对其导入的任何项目可见。Project-scope describes an MSBuild object, for example, a local property, that is visible only in the containing project file and to any projects that it imports.

项目,子项目project, child
在项目生成期间,由 MSBuild 任务创建的子项目。A child project is created by the MSBuild task during a project build. 此新项目是项目的子项目,该父项目需包含或导入具有 MSBuild 任务的目标。This new project is a child of the project that contains or imports the target that contains the MSBuild task. 除非使用 Properties 属性进行了修改,否则子项目会继承父项目的全局属性。The child project inherits the global properties of the parent project, unless they are modified by the Properties attribute.

redist 列表redist list
重新分发列表:对应于给定框架的程序集列表。Redistribution list: the list of assemblies that correspond to a given framework.

引用程序集reference assembly
设计时期间用于创建应用程序的程序集。An assembly that is used during design time to create an application. 可从引用程序集删除实际代码和私有接口,仅留下元数据和公共接口。A reference assembly can have the actual code and private interfaces removed from it, leaving only the metadata and public interfaces.

注册表属性registry property
请参阅属性,注册表See property, registry.

目标target
目标按特定的顺序将任务组合到一起,并将项目文件的各个部分作为生成过程入口点公开。A target groups tasks together in a particular order and exposes sections of the project file as entry points into the build process. 有关详细信息,请参阅目标For more information, see Targets.

目标,生成target, building
请参阅目标,运行。See target, running.

目标,评估target, evaluating
由于增量编译,必须针对属性和项可能出现的更改进行目标分析。Because of incremental compilation, targets must be analyzed for potential changes to properties and items. 即使跳过该目标,也必须进行更改。Even if the target is skipped, these changes must be made. 评估目标意味着执行此分析并进行更改。Evaluating a target means performing this analysis and making these changes. 有关详细信息,请参阅增量生成For more information, see Incremental builds.

目标,执行target, executing
执行目标意味着对其进行评估并执行所有没有任何条件,或其条件评估结果均为 true 的任务。Executing a target means evaluating it and executing all tasks that have no conditions, or whose conditions evaluate to true. 增量编译期间可能会跳过或执行目标,但始终会进行评估。During incremental compilation, targets may be skipped or executed, but they are always evaluated. 有关详细信息,请参阅目标,评估。For more information, see target, evaluating.

目标,运行target, running
不会运行条件评估结果为 false 的目标,也就是说,它不会影响生成。A target that has a condition that evaluates to false is not run, that is, has no effect on the build. 运行的目标已执行或跳过。Targets that run are either executed or skipped. 在任一情况下,都会对目标进行评估。In either case, the target is evaluated. 有关详细信息,请参阅目标,评估。For more information, see target, evaluating.

目标,跳过target, skipping
如果增量编译确定所有输出文件都是最新的,则跳过目标,也就是说,会对目标进行评估,但不执行目标内的任务。If incremental compilation determines that all output files are up-to-date, then the target is skipped, that is, the target is evaluated, but the tasks within the target are not executed. 有关详细信息,请参阅目标,评估。For more information, see target, evaluating.

目标框架名字对象target framework moniker
描述目标框架(例如 .NETFramework、Silverlight 等)、版本和配置文件(例如客户端、服务器等)的名称。A name that describes the framework (such as .NETFramework, Silverlight, etc.), the version, and the profile (such as Client, Server, etc.) that you wish to target.

目标包targeting pack
随给定框架和该框架的引用程序集一起分发的程序集列表。The list of assemblies that are distributed with a given framework and the set of reference assemblies for that framework.

目标文件targets file
目标文件是包含大部分指导生成的目标和任务的项目文件。A targets file is a project file that contains mostly targets and tasks that guide the build. 按照约定,其文件扩展名为 .targets 。By convention, It has the file extension .targets. 通常在关联的项目文件的结尾导入目标文件。Target files are typically imported at the end of associated project files.

任务task
任务是 MSBuild 项目用于执行生成操作的可执行代码单元。Tasks are units of executable code that MSBuild projects use to perform build operations. 例如,任务可能编译输入文件或运行外部工具。For example, a task might compile input files or run an external tool. 有关详细信息,请参阅任务For more information, see Tasks.

转换transform
转换是指采用一对一的方式将一个项集合转换为另一集合。A transform is a one-to-one conversion of one item collection to another. 除了使项目转换项集合外,转换也可让目标在其输入和输出间标识直接映射。In addition to enabling a project to convert item collections, a transform enables a target to identify a direct mapping between its inputs and outputs. 有关详细信息,请参阅转换For more information, see Transforms.

已知元数据well-known metadata
请参阅元数据,已知See metadata, well-known.

请参阅See also