Skip to content

Commit 49acef8

Browse files
Merge pull request #10485 from ghogen/refresh-dates
Review and update text and screenshots, if needed
2 parents 8d0e5f1 + 41f964e commit 49acef8

File tree

4 files changed

+29
-23
lines changed

4 files changed

+29
-23
lines changed

docs/msbuild/customize-your-build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Customize your build | Microsoft Docs
33
description: Learn about several extensibility hooks you can use to customize MSBuild projects that use the standard build process.
44
ms.custom: SEO-VS-2020
5-
ms.date: 09/13/2021
5+
ms.date: 10/07/2022
66
ms.topic: conceptual
77
helpviewer_keywords:
88
- MSBuild, transforms

docs/msbuild/msbuild.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: MSBuild | Microsoft Docs
33
description: Learn about how the Microsoft Build Engine (MSBuild) platform provides a project file with an XML schema to control builds.
44
ms.custom: SEO-VS-2020
5-
ms.date: 08/11/2021
5+
ms.date: 10/07/2022
66
ms.topic: conceptual
77
helpviewer_keywords:
88
- MSBuild, about MSBuild
@@ -17,7 +17,7 @@ ms.workload:
1717
---
1818
# MSBuild
1919

20-
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio. By invoking *msbuild.exe* on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn't installed.
20+
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio. By invoking *msbuild.exe* or *dotnet build* on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn't installed.
2121

2222
Visual Studio uses MSBuild to load and build managed projects. The project files in Visual Studio (*.csproj*, *.vbproj*, *.vcxproj*, and others) contain MSBuild XML code that executes when you build a project by using the IDE. Visual Studio projects import all the necessary settings and build processes to do typical development work, but you can extend or modify them from within Visual Studio or by using an XML editor.
2323

@@ -65,11 +65,19 @@ MSBuild.exe MyProj.proj -property:Configuration=Debug
6565
> [!IMPORTANT]
6666
> Before you download a project, determine the trustworthiness of the code.
6767
68+
For .NET Core and .NET 5 or later, you typically use `dotnet build` to invoke MSBuild. See [dotnet build](/dotnet/core/tools/dotnet-build).
69+
6870
## Project file
6971

7072
MSBuild uses an XML-based project file format that's straightforward and extensible. The MSBuild project file format lets developers describe the items that are to be built, and also how they are to be built for different operating systems and configurations. In addition, the project file format lets developers author reusable build rules that can be factored into separate files so that builds can be performed consistently across different projects in the product.
7173

72-
The Visual Studio build system stores project-specific logic in the your project file itself, and uses imported MSBuild XML files with extensions like *.props* and *.targets* to define the standard build logic. The *.props* files define MSBuild properties, and *.targets* files define MSBuild targets. These imports are sometimes visible in the Visual Studio project file, but in newer projects such as .NET Core, .NET 5 and .NET 6 projects, you don't see the imports in the project file; instead, you see an SDK reference. These are called SDK-style projects. When you reference an SDK such as the .NET SDK, the imports of .props and .target files are implicitly specified by the SDK.
74+
The Visual Studio build system stores project-specific logic in the your project file itself, and uses imported MSBuild XML files with extensions like `.props` and `.targets` to define the standard build logic. The `.props` files define MSBuild properties, and `.targets` files define MSBuild targets. These imports are sometimes visible in the Visual Studio project file, but in newer projects such as .NET Core, .NET 5 and .NET 6 projects, you don't see the imports in the project file; instead, you see an SDK reference, which looks like this:
75+
76+
```xml
77+
<Project Sdk="Microsoft.Net.Sdk">
78+
```
79+
80+
These are called SDK-style projects. When you reference an SDK such as the .NET SDK, the imports of `.props` and `.target` files are implicitly specified by the SDK.
7381

7482
The following sections describe some of the basic elements of the MSBuild project file format. For a tutorial about how to create a basic project file, see [Walkthrough: Creating an MSBuild project file from scratch](../msbuild/walkthrough-creating-an-msbuild-project-file-from-scratch.md).
7583

docs/msbuild/troubleshooting-dotnet-framework-targeting-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Troubleshooting .NET Framework Targeting Errors | Microsoft Docs
33
description: Learn about MSBuild errors that might occur because of reference issues and how you can resolve those errors.
44
ms.custom: SEO-VS-2020
5-
ms.date: 06/13/2021
5+
ms.date: 10/07/2022
66
ms.topic: troubleshooting
77
f1_keywords:
88
- vs.FrameworkTargetingErrors

docs/msbuild/walkthrough-using-msbuild.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use MSBuild
33
description: Learn the various parts of an MSBuild project file, including items, item metadata, properties, targets, and tasks.
4-
ms.date: 07/28/2021
4+
ms.date: 10/07/2022
55
ms.topic: conceptual
66
ms.custom: contperf-fy21q2
77
helpviewer_keywords:
@@ -88,17 +88,13 @@ Project files are XML-formatted files with the root node [Project](../msbuild/pr
8888
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
8989
```
9090

91-
Newer .NET Core (SDK-style) projects have a `Sdk` attribute.
91+
Most .NET projects have a `Sdk` attribute. These are called SDK-style projects.
9292

9393
```xml
9494
<Project Sdk="Microsoft.NET.Sdk">
9595
```
9696

97-
If the project is not an SDK-style project, you must specify the xmlns namespace in the Project element. If `ToolsVersion` is present in a new project, it must match the MSBuild version. If you don't know the MSBuild version, you can get it from the first two numbers from the output of the following command line (for example, 16.0):
98-
99-
```console
100-
MSBuild -ver
101-
```
97+
There are many variations of .NET SDKs for special purposes; they are described at [.NET Project SDKs](/dotnet/core/project-sdk/overview).
10298

10399
The work of building an application is done with [Target](../msbuild/target-element-msbuild.md) and [Task](../msbuild/task-element-msbuild.md) elements.
104100

@@ -144,9 +140,9 @@ MSBuild keeps track of the targets of a build, and guarantees that each target i
144140

145141
3. Save the project file.
146142

147-
The Message task is one of the many tasks that ships with MSBuild. For a complete list of available tasks and usage information, see [Task reference](../msbuild/msbuild-task-reference.md).
143+
The `Message` task is one of the many tasks that ships with MSBuild. For a complete list of available tasks and usage information, see [Task reference](../msbuild/msbuild-task-reference.md).
148144

149-
The Message task takes the string value of the Text attribute as input and displays it on the output device (or writes it to one or more logs, if applicable). The HelloWorld target executes the Message task twice: first to display "Hello", and then to display "World".
145+
The `Message` task takes the string value of the Text attribute as input and displays it on the output device (or writes it to one or more logs, if applicable). The HelloWorld target executes the Message task twice: first to display "Hello", and then to display "World".
150146

151147
## Build the target
152148

@@ -161,7 +157,7 @@ Run MSBuild from the **Developer Command Prompt** for Visual Studio to build the
161157

162158
1. Open the **Command Window**.
163159

164-
(Windows 10) In the search box on the taskbar, start typing the name of the tool, such as `dev` or `developer command prompt`. This brings up a list of installed apps that match your search pattern.
160+
In the search box on the taskbar, start typing the name of the tool, such as `dev` or `developer command prompt`. This brings up a list of installed apps that match your search pattern.
165161

166162
If you need to find it manually, the file is *LaunchDevCmd.bat* in the *<visualstudio installation folder\>\Common7\Tools* folder.
167163

@@ -350,7 +346,7 @@ All items are child elements of ItemGroup elements. The item name is the name of
350346

351347
defines an item group containing two items. The item type Compile has two values: *Program.cs* and *Properties\AssemblyInfo.cs*.
352348

353-
The following code creates the same item type by declaring both files in one Include attribute, separated by a semicolon.
349+
The following code creates the same item type by declaring both files in one `Include` attribute, separated by a semicolon.
354350

355351
```xml
356352
<ItemGroup>
@@ -365,13 +361,13 @@ For more information, see [Items](../msbuild/msbuild-items.md).
365361
366362
## Examine item type values
367363

368-
To get the values of an item type, use the following syntax, where ItemType is the name of the item type:
364+
To get the values of an item type, use the following syntax, where `ItemType` is the name of the item type:
369365

370366
```xml
371367
@(ItemType)
372368
```
373369

374-
Use this syntax to examine the Compile item type in the project file.
370+
Use this syntax to examine the `Compile` item type in the project file.
375371

376372
**To examine item type values:**
377373

@@ -393,7 +389,7 @@ Use this syntax to examine the Compile item type in the project file.
393389

394390
1. Examine the output. You should see this long line:
395391

396-
```
392+
```output
397393
Compile item type contains Form1.cs;Form1.Designer.cs;Program.cs;Properties\AssemblyInfo.cs;Properties\Resources.Designer.cs;Properties\Settings.Designer.cs
398394
```
399395

@@ -425,7 +421,7 @@ Change the Message task to use carriage returns and line feeds (%0A%0D) to displ
425421

426422
4. Examine the output. You should see these lines:
427423

428-
```
424+
```output
429425
Compile item type contains Form1.cs
430426
Form1.Designer.cs
431427
Program.cs
@@ -506,7 +502,7 @@ would not exclude the file *Form1.cs*, which was added in the preceding item ele
506502

507503
5. Examine the output. You should see this line:
508504

509-
```
505+
```output
510506
XFiles item type contains Form1.cs;Program.cs;Properties/Resources.resx
511507
```
512508

@@ -524,7 +520,7 @@ would not exclude the file *Form1.cs*, which was added in the preceding item ele
524520
</ItemGroup>
525521
```
526522

527-
To get the metadata value of an item type, use the following syntax, where ItemType is the name of the item type and MetaDataName is the name of the metadata:
523+
To get the metadata value of an item type, use the following syntax, where `ItemType` is the name of the item type and MetaDataName is the name of the metadata:
528524

529525
```xml
530526
%(ItemType.MetaDataName)
@@ -626,7 +622,9 @@ Notice that metadata expressed in this syntax does not cause batching.
626622

627623
## Next steps
628624

629-
To learn how to create a simple project file one step at a time, try out the [Walkthrough: Creating an MSBuild project file from scratch](../msbuild/walkthrough-creating-an-msbuild-project-file-from-scratch.md).
625+
To learn how to create a simple project file one step at a time, on Windows, try out the [Walkthrough: Creating an MSBuild project file from scratch](../msbuild/walkthrough-creating-an-msbuild-project-file-from-scratch.md).
626+
627+
If you're primarily using the .NET SDK, you may wish to continue reading at [MSBuild Reference for .NET SDK Projects](/dotnet/core/project-sdk/msbuild-props).
630628

631629
## See also
632630

0 commit comments

Comments
 (0)