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
The `dotnet build` command builds multiple source file from a source project and its dependencies into a binary.
32
31
By default, the resulting binary is in Intermediate Language (IL) and has a DLL extension.
@@ -55,31 +54,35 @@ In order to build an executable application instead of a library, you need a [sp
55
54
}
56
55
```
57
56
58
-
## OPTIONS
57
+
## Options
59
58
60
-
`-o`, `--output`[DIR]
59
+
`-h|--help`
61
60
62
-
Directory in which to place the built binaries.
61
+
Prints out a short help for the command.
63
62
64
-
`-b`, `--build-base-path`[DIR]
63
+
`-o|--output <OUTPUT_DIRECTORY>`
64
+
65
+
Directory in which to place the built binaries. You also need to define `--framework` when you specify this option.
66
+
67
+
`-b|--build-base-path <OUTPUT_DIRECTORY>`
65
68
66
69
Directory in which to place temporary outputs.
67
70
68
-
`-f`, `--framework`[FRAMEWORK]
71
+
`-f|--framework <FRAMEWORK>`
69
72
70
-
Compiles for a specific framework. The framework needs to be defined in the project.json file.
73
+
Compiles for a specific framework. The framework needs to be defined in the [project.json](project-json.md#frameworks) file.
71
74
72
-
`-c`, `--configuration`[Debug|Release]
75
+
`-c|--configuration [Debug|Release]`
73
76
74
-
Defines a configuration under which to build. If omitted, it defaults to Debug.
77
+
Defines a configuration under which to build. If omitted, it defaults to `Debug`.
75
78
76
-
`-r`, `--runtime`[RUNTIME_IDENTIFIER]
79
+
`-r|--runtime [RUNTIME_IDENTIFIER]`
77
80
78
-
Target runtime to build for.
81
+
Target runtime to build for. For a list of Runtime Identifiers (RIDs) you can use, see the [RID catalog](../rid-catalog.md).
79
82
80
-
`--version-suffix`[VERSION_SUFFIX]
83
+
`--version-suffix [VERSION_SUFFIX]`
81
84
82
-
Defines what `*` should be replaced with in the version field in the project.json file. The format follows NuGet's version guidelines.
85
+
Defines what `*` should be replaced with in the version field in the [project.json](project-json.md#version) file. The format follows NuGet's version guidelines.
83
86
84
87
`--build-profile`
85
88
@@ -92,3 +95,17 @@ Marks the build as unsafe for incremental build. This turns off incremental comp
92
95
`--no-dependencies`
93
96
94
97
Ignores project-to-project references and only builds the root project specified to build.
98
+
99
+
## Examples
100
+
101
+
Build a project and its dependencies:
102
+
103
+
`dotnet build`
104
+
105
+
Build a project and its dependencies using Release configuration:
106
+
107
+
`dotnet build --configuration Release`
108
+
109
+
Build a project and its dependencies for a specific runtime (in this example, Ubuntu 16.04):
dotnet-install.ps1 | dotnet-install.sh - script used to install the Command Line Interface (CLI) tools and shared runtime
17
+
## Name
18
+
dotnet-install.ps1 | dotnet-install.sh - script used to install the Command Line Interface (CLI) tools and the shared runtime
20
19
21
-
## SYNOPSIS
20
+
## Synopsis
22
21
Windows:
23
22
24
23
`dotnet-install.ps1 [-Channel][-Version]
25
24
[-InstallDir][-Debug][-NoPath]
26
25
[-SharedRuntime]`
27
26
28
-
OS X/Linux:
27
+
macOS/Linux:
29
28
30
29
`dotnet-install.sh [--channel][--version]
31
30
[--install-dir][--debug][--no-path]
32
31
[--shared-runtime]`
33
32
34
-
## DESCRIPTION
33
+
## Description
35
34
The `dotnet-install` scripts are used to perform a non-admin install of the CLI toolchain and the shared runtime. You can download the scripts from our [CLI GitHub repo](https://github.com/dotnet/cli/tree/rel/1.0.0-preview2/scripts/obtain).
36
35
37
36
Their main use case is to help with automation scenarios and non-admin installations. There are two scripts, one for PowerShell that works on Windows and a bash script that works on Linux/OS X. They both have the same behavior. Bash script also "understands" PowerShell switches so you can use them across the board.
@@ -43,7 +42,7 @@ By default, the script will add the install location to the $PATH for the curren
43
42
44
43
Before running the script, please install all the required [dependencies](https://github.com/dotnet/core/blob/master/Documentation/prereqs.md).
45
44
46
-
You can install a specific version using the `--version` argument. The version needs to be specified as 3-part version (for example 1.0.0-13232). If omitted, it will default to the first global.json file found in the hierarchy above the folder where the script was invoked in that contains the `sdkVersion` property. If that is not present, it will use Latest.
45
+
You can install a specific version using the `--version` argument. The version needs to be specified as 3-part version (for example, 1.0.0-13232). If omitted, it will default to the first [global.json](global-json.md) file found in the hierarchy above the folder where the script was invoked in that contains the `sdkVersion` property. If that is not present, it will use Latest.
47
46
48
47
You can also use this script to get the SDK or shared runtime debug binaries with debug symbols by using the `--debug` argument. If you do not do this on first install and realize you do need debug symbols later on, you can re-run the script with this argument and the version of the bits you installed.
49
48
@@ -53,83 +52,75 @@ Options are different between script implementations.
53
52
### PowerShell (Windows)
54
53
`-Channel [CHANNEL]`
55
54
56
-
Which channel (for example, "future", "preview", "production") to install from. The default value is "Production".
55
+
Which channel (for example, `future`, `preview`, `production`) to install from. The default value is `production`.
57
56
58
57
`-Version [VERSION]`
59
58
60
-
Which version of CLI to install; you need to specify the version as 3-part version (i.e. 1.0.0-13232). If omitted, it will default to the first global.json that contains the sdkVersion property; if that is not present, it will use Latest.
59
+
Which version of CLI to install; you need to specify the version as 3-part version (for example, 1.0.0-13232). If omitted, it will default to the first [global.json](global-json.md) that contains the [sdkVersion](global-json.md#sdkversion) property; if that is not present, it will use Latest.
61
60
62
61
`-InstallDir [DIR]`
63
62
64
-
Path to install to. The directory is created if it doesn't exist. The default value is `%LocalAppData%\.dotnet`.
63
+
Path to install to. The directory is created if it doesn't exist. The default value is *%LocalAppData%\.dotnet*.
65
64
66
65
`-Debug`
67
66
68
-
**true** to indicate that larger packages containing debugging symbols should be used; otherwise, **false**. The default value is **false**.
67
+
`true` to indicate that larger packages containing debugging symbols should be used; otherwise, `false`. The default value is `false`.
69
68
70
69
`-NoPath`
71
70
72
-
**true** to indicate that the prefix/installdir are not exported to the path for the current session; otherwise, **false**.
73
-
The default value is **false**, that is, the PATH is modified.
71
+
`true` to indicate that the prefix/installdir are not exported to the path for the current session; otherwise, `false`.
72
+
The default value is `false`, that is, the PATH is modified.
74
73
This makes the CLI tools available immediately after install.
75
74
76
75
`-SharedRuntime`
77
76
78
-
**true** to install just the shared runtime bits; **false** to install the entire SDK. The default value is **false**.
77
+
`true` to install just the shared runtime bits; `false` to install the entire SDK. The default value is `false`.
79
78
80
-
### Bash (OS X/Linux)
79
+
### Bash (macOS/Linux)
81
80
`--channel [CHANNEL]`
82
81
83
82
Which channel (for example "future", "preview", "production") to install from. The default value is "Production".
84
83
85
84
`--version [VERSION]`
86
85
87
-
Which version of CLI to install; you need to specify the version as 3-part version (i.e. 1.0.0-13232). If omitted, it will default to the first global.json that contains the sdkVersion property; if that is not present, it will use Latest.
86
+
Which version of CLI to install; you need to specify the version as 3-part version (for example, 1.0.0-13232). If omitted, it will default to the first [global.json](global-json.md) that contains the [sdkVersion](global-json.md#sdkversion) property; if that is not present, it will use Latest.
88
87
89
88
`--install-dir [DIR]`
90
89
91
90
Path to where to install. The directory is created if it doesn't exist. The default value is `$HOME/.dotnet`.
92
91
93
92
`--debug`
94
93
95
-
**true** to indicate that larger packages containing debugging symbols should be used; otherwise, **false**. The default value is **false**.
94
+
`true` to indicate that larger packages containing debugging symbols should be used; otherwise, `false`. The default value is `false`.
96
95
97
96
`--no-path`
98
97
99
-
**true** to indicate that the prefix/installdir are not exported to the path for the current session; otherwise, **false**.
100
-
The default value is **false**, that is, the PATH is modified.
98
+
`true` to indicate that the prefix/installdir are not exported to the path for the current session; otherwise, `false`.
99
+
The default value is `false`, that is, the PATH is modified.
101
100
This makes the CLI tools available immediately after install.
102
101
103
102
`--shared-runtime`
104
103
105
-
**true** to install just the shared runtime bits; **false** to install the entire SDK. The default value is **false**.
104
+
`true` to install just the shared runtime bits; `false` to install the entire SDK. The default value is `false`.
106
105
107
-
## EXAMPLES
106
+
## Examples
107
+
108
+
Install the dev latest version to the default location:
108
109
109
110
Windows:
110
111
111
-
```
112
-
./dotnet-install.ps1 -Channel Future
113
-
```
112
+
`./dotnet-install.ps1 -Channel Future`
114
113
115
-
OS X/Linux:
114
+
macOS/Linux:
116
115
117
-
```
118
-
./dotnet-install.sh --channel Future
119
-
```
116
+
`./dotnet-install.sh --channel Future`
120
117
121
-
Installs the dev latest version to the default location.
118
+
Install the latest preview to the specified location:
description: The dotnet-new command creates new .NET Core projects in the current directory.
4
+
keywords: dotnet-new, CLI, CLI command, .NET Core
5
5
author: mairaw
6
6
manager: wpickett
7
-
ms.date: 06/20/2016
7
+
ms.date: 10/12/2016
8
8
ms.topic: article
9
9
ms.prod: .net-core
10
10
ms.technology: .net-core-technologies
11
11
ms.devlang: dotnet
12
12
ms.assetid: 263c3d05-3a47-46a6-8023-3ca16b488410
13
13
---
14
14
15
-
dotnet-new
16
-
==========
15
+
#dotnet-new
17
16
18
-
## NAME
19
-
dotnet-new -- Creates a new .NET Core project
17
+
## Name
18
+
dotnet-new -- Creates a new .NET Core project in the current directory
20
19
21
-
## SYNOPSIS
22
-
`dotnet new [--type] [--lang]`
20
+
## Synopsis
21
+
`dotnet new [--help] [--type] [--lang]`
23
22
24
-
## DESCRIPTION
23
+
## Description
25
24
The `dotnet new` command provides a convenient way to initialize a valid .NET Core project and sample source code to try out the Command Line Interface (CLI) toolset.
26
25
27
-
This command is invoked in the context of a directory. When invoked, the command will result in two main artifacts being dropped to the directory:
26
+
This command is invoked in the context of a directory. When invoked, the command will result in two main artifacts being dropped to the current directory:
28
27
29
28
1. A `Program.cs` (or `Program.fs`) file that contains a sample "Hello World" program.
30
29
2. A valid `project.json` file.
@@ -33,28 +32,28 @@ After this, the project is ready to be compiled and/or edited further.
33
32
34
33
## Options
35
34
36
-
`-l`, `--lang [C#|F#]`
35
+
`-h|--help`
37
36
38
-
Language of the project. Defaults to `C#`. `csharp` (`fsharp`) or `cs` (`fs`) are also valid options.
37
+
Prints out a short help for the command.
39
38
40
-
`-t`, `--type`
39
+
`-l|--lang <C#|F#>`
41
40
42
-
Type of the project. Valid values are `console`, `web`, `lib` and `xunittest`.
41
+
Language of the project. Defaults to `C#`. Other valid values are `csharp`, `fsharp`, `cs` and `fs`.
43
42
44
-
## EXAMPLES
43
+
`-t|--type`
45
44
46
-
`dotnet new`
47
-
48
-
Drops a C# project in the current directory.
45
+
Type of the project. Valid values for C# are `console`, `web`, `lib` and `xunittest` and for F# only `console` is valid.
49
46
50
-
`dotnet new --lang f#`
51
-
52
-
Drops an F# project in the current directory.
47
+
## Examples
48
+
49
+
Create a C# console application project in the current directory:
53
50
54
-
`dotnet new --lang c#`
55
-
56
-
Drops an C# project in the current directory.
51
+
`dotnet new` or `dotnet new --lang c#`
52
+
53
+
Create an F# console application project in the current directory:
54
+
55
+
`dotnet new --lang f#`
56
+
57
+
Create a new ASP.NET Core C# application project in the current directory:
57
58
58
-
`dotnet new -t web`
59
-
60
-
Drops a new ASP.NET Core project in the current directory.
0 commit comments