You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: The dotnet build command builds a project and all of its dependencies.
4
4
author: mairaw
5
5
ms.author: mairaw
6
-
ms.date: 03/10/2018
6
+
ms.date: 05/25/2018
7
7
---
8
8
# dotnet-build
9
9
@@ -35,23 +35,23 @@ The `dotnet build` command builds the project and its dependencies into a set of
35
35
36
36
If the project has third-party dependencies, such as libraries from NuGet, they're resolved from the NuGet cache and aren't available with the project's built output. With that in mind, the product of `dotnet build` isn't ready to be transferred to another machine to run. This is in contrast to the behavior of the .NET Framework in which building an executable project (an application) produces output that's runnable on any machine where the .NET Framework is installed. To have a similar experience with .NET Core, you need to use the [dotnet publish](dotnet-publish.md) command. For more information, see [.NET Core Application Deployment](../deploying/index.md).
37
37
38
-
Building requires the *project.assets.json* file, which lists the dependencies of your application. The file is created when [`dotnet restore`](dotnet-restore.md) is executed. Without the assets file in place, the tooling cannot resolve reference assemblies, which results in errors. With .NET Core 1.x SDK, you needed to explicitily run the `dotnet restore` before running `dotnet build`. Starting with .NET Core 2.0 SDK, `dotnet restore` runs implicitily when you run `dotnet build`. If you want to disable implicit restore when running the build command, you can pass the `--no-restore` option.
38
+
Building requires the *project.assets.json* file, which lists the dependencies of your application. The file is created when [`dotnet restore`](dotnet-restore.md) is executed. Without the assets file in place, the tooling cannot resolve reference assemblies, which results in errors. With .NET Core 1.x SDK, you needed to explicitly run the `dotnet restore` before running `dotnet build`. Starting with .NET Core 2.0 SDK, `dotnet restore` runs implicitly when you run `dotnet build`. If you want to disable implicit restore when running the build command, you can pass the `--no-restore` option.
`dotnet build` uses MSBuild to build the project; thus, it supports both parallel and incremental builds. Refer to [Incremental Builds](/visualstudio/msbuild/incremental-builds) for more information.
42
+
`dotnet build` uses MSBuild to build the project, so it supports both parallel and incremental builds. For more information, see [Incremental Builds](/visualstudio/msbuild/incremental-builds).
43
43
44
-
In addition to its options, the `dotnet build` command accepts MSBuild options, such as `/p` for setting properties or `/l` to define a logger. Learn more about these options in the [MSBuild Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference).
44
+
In addition to its options, the `dotnet build` command accepts MSBuild options, such as `/p` for setting properties or `/l` to define a logger. For more information about these options, see the [MSBuild Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference).
45
45
46
-
Whether the project is executable or not is determined by the `<OutputType>` property in the project file. The following example shows a project that will produce executable code:
46
+
Whether the project is executable or not is determined by the `<OutputType>` property in the project file. The following example shows a project that produces executable code:
47
47
48
48
```xml
49
49
<PropertyGroup>
50
50
<OutputType>Exe</OutputType>
51
51
</PropertyGroup>
52
52
```
53
53
54
-
In order to produce a library, omit the `<OutputType>` property. The main difference in built output is that the IL DLL for a library doesn't contain entry points and can't be executed.
54
+
In order to produce a library, omit the `<OutputType>` property. The main difference in built output is that the IL DLL for a library doesn't contain entry points and can't be executed.
55
55
56
56
## Arguments
57
57
@@ -73,23 +73,23 @@ Compiles for a specific [framework](../../standard/frameworks.md). The framework
73
73
74
74
`--force`
75
75
76
-
Forces all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting the *project.assets.json* file.
76
+
Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file.
77
77
78
78
`-h|--help`
79
79
80
80
Prints out a short help for the command.
81
81
82
82
`--no-dependencies`
83
83
84
-
Ignores project-to-project (P2P) references and only builds the root project specified to build.
84
+
Ignores project-to-project (P2P) references and only builds the specified root project.
85
85
86
86
`--no-incremental`
87
87
88
-
Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
88
+
Marks the build as unsafe for incremental build. This flag turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
89
89
90
90
`--no-restore`
91
91
92
-
Doesn't perform an implicit restore during build.
92
+
Doesn't execute an implicit restore during build.
93
93
94
94
`-o|--output <OUTPUT_DIRECTORY>`
95
95
@@ -123,11 +123,11 @@ Prints out a short help for the command.
123
123
124
124
`--no-dependencies`
125
125
126
-
Ignores project-to-project (P2P) references and only builds the root project specified to build.
126
+
Ignores project-to-project (P2P) references and only builds the specified root project.
127
127
128
128
`--no-incremental`
129
129
130
-
Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
130
+
Marks the build as unsafe for incremental build. This flag turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
The `dotnet migrate` command migrates a valid Preview 2 *project.json*-based project to a valid .NET Core SDK 1.0 *csproj* project.
25
+
The `dotnet migrate` command migrates a valid Preview 2 *project.json*-based project to a valid .NET Core SDK 1.0 *csproj* project.
23
26
24
-
By default, the command migrates the root project and any project references that the root project contains. This behavior is disabled using the `--skip-project-references` option at runtime.
27
+
By default, the command migrates the root project and any project references that the root project contains. This behavior is disabled using the `--skip-project-references` option at runtime.
25
28
26
-
Migration is performed on the following:
29
+
Migration can be performed on the following assets:
27
30
28
31
* A single project by specifying the *project.json* file to migrate.
29
32
* All of the directories specified in the *global.json* file by passing in a path to the *global.json* file.
30
33
* A *solution.sln* file, where it migrates the projects referenced in the solution.
31
-
* On all sub-directories of the given directory recursively.
34
+
* On all subdirectories of the given directory recursively.
32
35
33
36
The `dotnet migrate` command keeps the migrated *project.json* file inside a `backup` directory, which it creates if the directory doesn't exist. This behavior is overridden using the `--skip-backup` option.
34
37
35
-
By default, the migration operation outputs the state of the migration process to standard output (STDOUT). If you use the `--report-file <REPORT_FILE>` option, the output is saved to the file specify.
38
+
By default, the migration operation outputs the state of the migration process to standard output (STDOUT). If you use the `--report-file <REPORT_FILE>` option, the output is saved to the file specify.
36
39
37
40
The `dotnet migrate` command only supports valid Preview 2 *project.json*-based projects. This means that you cannot use it to migrate DNX or Preview 1 *project.json*-based projects directly to MSBuild/csproj projects. You first need to manually migrate the project to a Preview 2 *project.json*-based project and then use the `dotnet migrate` command to migrate the project.
38
41
@@ -43,45 +46,45 @@ The `dotnet migrate` command only supports valid Preview 2 *project.json*-based
43
46
The path to one of the following:
44
47
45
48
* a *project.json* file to migrate.
46
-
* a *global.json* file, it will migrate the folders specified in *global.json*.
47
-
* a *solution.sln* file, it will migrate the projects referenced in the solution.
48
-
* a directory to migrate, it will recursively search for *project.json* files to migrate.
49
+
* a *global.json* file: the folders specified in *global.json* are migrated.
50
+
* a *solution.sln* file: the projects referenced in the solution are migrated.
51
+
* a directory to migrate: recursively searches for *project.json* files to migrate inside the specified directory.
49
52
50
53
Defaults to current directory if nothing is specified.
51
54
52
55
## Options
53
56
54
-
`-h|--help`
55
-
56
-
Prints out a short help for the command.
57
-
58
-
`-t|--template-file <TEMPLATE_FILE>`
57
+
`--format-report-file-json <REPORT_FILE>`
59
58
60
-
Template csproj file to use for migration. By default, the same template as the one dropped by `dotnet new console` is used.
59
+
Output migration report file as JSON rather than user messages.
61
60
62
-
`-v|--sdk-package-version <VERSION>`
61
+
`-h|--help`
63
62
64
-
The version of the sdk package that's referenced in the migrated app. The default is the version of the SDK in `dotnet new`.
63
+
Prints out a short help for the command.
65
64
66
-
`-x|--xproj-file <FILE>`
65
+
`-r|--report-file <REPORT_FILE>`
67
66
68
-
The path to the xproj file to use. Required when there is more than one xproj in a project directory.
67
+
Output migration report to a file in addition to the console.
69
68
70
69
`-s|--skip-project-references [Debug|Release]`
71
70
72
71
Skip migrating project references. By default, project references are migrated recursively.
73
72
74
-
`-r|--report-file <REPORT_FILE>`
73
+
`--skip-backup`
75
74
76
-
Output migration report to a file in addition to the console.
75
+
Skip moving *project.json*, *global.json*, and *\*.xproj*to a `backup` directory after successful migration.
77
76
78
-
`--format-report-file-json <REPORT_FILE>`
77
+
`-t|--template-file <TEMPLATE_FILE>`
79
78
80
-
Output migration report file as JSON rather than user messages.
79
+
Template csproj file to use for migration. By default, the same template as the one dropped by `dotnet new console` is used.
81
80
82
-
`--skip-backup`
81
+
`-v|--sdk-package-version <VERSION>`
83
82
84
-
Skip moving *project.json*, *global.json*, and *\*.xproj* to a `backup` directory after successful migration.
83
+
The version of the sdk package that's referenced in the migrated app. The default is the version of the SDK in `dotnet new`.
84
+
85
+
`-x|--xproj-file <FILE>`
86
+
87
+
The path to the xproj file to use. Required when there is more than one xproj in a project directory.
85
88
86
89
## Examples
87
90
@@ -95,4 +98,4 @@ Migrate all projects that *global.json* file includes:
95
98
96
99
Migrate only the current project and no project-to-project (P2P) dependencies. Also, use a specific SDK version:
description: The dotnet msbuild command provides access to the MSBuild command line.
4
4
author: mairaw
5
5
ms.author: mairaw
6
-
ms.date: 08/14/2017
6
+
ms.date: 05/25/2018
7
7
---
8
8
# dotnet msbuild
9
9
@@ -21,7 +21,7 @@ ms.date: 08/14/2017
21
21
22
22
The `dotnet msbuild` command allows access to a fully functional MSBuild.
23
23
24
-
The command has the exact same capabilities as existing MSBuild command-line client. The options are all the same. Use the [MSBuild Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference) to obtain information on the available options.
24
+
The command has the exact same capabilities as existing MSBuild command-line client. The options are all the same. For more information about the available options, see the [MSBuild Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference).
0 commit comments