Skip to content

Commit 1a4cb06

Browse files
svickmairaw
authored andcommitted
Preview 3 edits (#1273)
* Preview 3 edits * Added migrate to the list of commands * Used docfx syntax for notes * Fixed heading levels in new articles * Made pseudo-variables in csproj consistent in dependencies * Remove references to project.json sections from deploying * Remove F# from dotnet new, since it's not supported * Added back missing --framework to dotnet test * Typos, grammar and other small fixes * Removed unnecessary Overview headings
1 parent 0ca8055 commit 1a4cb06

File tree

12 files changed

+84
-87
lines changed

12 files changed

+84
-87
lines changed

docs/core/preview3/deploying/index.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Deploying a framework-dependent deployment with one or more third-party dependen
118118
</ItemGroup>
119119
```
120120

121-
Note that the SDK dependency remains in the above example. This is by design, since this depdendency is required to restore all the needed targets to allow the command line tools to function.
121+
Note that the SDK dependency remains in the above example. This is by design, since this depdendency is required to restore all the needed targets to allow the command line tools to function.
122122

123123
2. If you haven't already, download the NuGet package containing the third-party dependency. To download the package, execute the `dotnet restore` command after adding the dependency. Because the dependency is resolved out of the local NuGet cache at publish time, it must be available on your system.
124124

@@ -186,7 +186,7 @@ Deploying a self-contained deployment with no third-party dependencies involves
186186
}
187187
```
188188

189-
3. Create a `<RuntimeIdentifiers>` tag under the `<PropertyGroup>` section in your `csproj` file that defines the platforms your app targets, and specify the runtime identifier of each platform that you target. See [Runtime IDentifier catalog](../../rid-catalog.md) for a list of runtime identifiers. For example, the following `runtimes` section indicates that the app runs on 64-bit Windows 10 operating systems and the 64-bit OS X Version 10.11 operating system.
189+
3. Create a `<RuntimeIdentifiers>` tag under the `<PropertyGroup>` section in your `csproj` file that defines the platforms your app targets, and specify the runtime identifier of each platform that you target. See [Runtime IDentifier catalog](../../rid-catalog.md) for a list of runtime identifiers. For example, the following example indicates that the app runs on 64-bit Windows 10 operating systems and the 64-bit OS X Version 10.11 operating system.
190190

191191
```xml
192192
<PropertyGroup>
@@ -316,16 +316,14 @@ If the availability of adequate storage space on target systems is likely to be
316316

317317
To create a self-contained deployment with a smaller footprint, start by following the first two steps for creating a self-contained deployment. Once you've run the `dotnet new` command and added the C# source code to your app, do the following:
318318

319-
1. Open the `csproj` file and replace the `frameworks` section with the following:
319+
1. Open the `csproj` file and replace the `<TargetFramework>` element with the following:
320320

321321
```xml
322-
<PropertyGroup>
323322
<TargetFramework>netstandard1.6</TargetFramework>
324-
</PropertyGroup>
325323
```
326324
This operation indicates that, instead of using the entire `netcoreapp1.0` framework, which includes .NET Core CLR, the .NET Core Library, and a number of other system components, our app uses only the .NET Standard Library.
327325

328-
2. Replace the `dependencies` section with the following:
326+
2. Replace the `<ItemGroup>` containing package references with the following:
329327

330328
```xml
331329
<ItemGroup>
@@ -356,7 +354,7 @@ This operation indicates that, instead of using the entire `netcoreapp1.0` frame
356354
```
357355

358356

359-
A complete sample `csproj` file appears later in this section.
357+
A complete sample `csproj` file appears later in this section.
360358

361359
4. Run the `dotnet restore` command to restore the dependencies specified in your project.
362360

@@ -386,7 +384,7 @@ The following is the complete `csproj` file for this project.
386384
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
387385
<PropertyGroup>
388386
<OutputType>Exe</OutputType>
389-
<TargetFramework>netcoreapp1.0</TargetFramework>
387+
<TargetFramework>netstandard1.6</TargetFramework>
390388
<VersionPrefix>1.0.0</VersionPrefix>
391389
<DebugType>Portable</DebugType>
392390
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>

docs/core/preview3/tools/csproj.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@ ms.devlang: dotnet
1313
ms.assetid: bdc29497-64f2-4d11-a21b-4097e0bdf5c9
1414
---
1515

16-
Additions to csproj format for .NET Core
17-
----------------------------------------
16+
# Additions to csproj format for .NET Core
1817

19-
# Overview
2018
This document outlines the changes that were added to the csproj files as part of the move from project.json to csproj and
2119
[MSBuild](https://github.com/Microsoft/MSBuild). This document outlines **only the deltas to non-core csproj files**. If
2220
you need more information about general project file syntax and reference, please consult [the MSBuild project file]() documentation.
2321

24-
> **Note:** this document will grow in the future, so please check back to see new additions.
22+
> ![NOTE]
23+
> This document will grow in the future, so please check back to see new additions.
2524
26-
# Additions
25+
## Additions
2726

28-
## PackageReference
27+
### PackageReference
2928
Specifies a NuGet dependency in the project. The `Include` attribute specifies the package ID.
3029

3130
```xml
@@ -37,73 +36,74 @@ Specifies a NuGet dependency in the project. The `Include` attribute specifies t
3736
</PackageReference>
3837
```
3938

40-
### Version
41-
`<Version>` specifies the version of the package to restore. The element respect the rules of the NuGet versioning scheme.
39+
#### Version
40+
`<Version>` specifies the version of the package to restore. The element respects the rules of the NuGet versioning scheme.
4241

43-
### IncludeAssets
42+
#### IncludeAssets
4443
`<IncludeAssets>` child element specifies what assets belonging to the package specified by parent `<PackageReference>` should be
4544
consumed.
4645

4746
The element can contain one or more of the following values:
4847

49-
* Compile – are the contents of the lib folder available to compile against
50-
* Runtime – are the contents of the runtime folder distributed
51-
* ContentFiles – are the contents of the contentfiles folder used
52-
* Build – do the props/targets in the build folder get used
53-
* Native - are the contents from native assets copied to the output folder for runtime
54-
* Analyzers – do the analyzers get used
48+
* Compile – are the contents of the lib folder available to compile against
49+
* Runtime – are the contents of the runtime folder distributed
50+
* ContentFiles – are the contents of the contentfiles folder used
51+
* Build – do the props/targets in the build folder get used
52+
* Native are the contents from native assets copied to the output folder for runtime
53+
* Analyzers – do the analyzers get used
5554

5655
Alternatively, the element can contain:
5756

58-
* None – none of those things get used
59-
* All – all of those things get used.
57+
* None – none of those things get used
58+
* All – all of those things get used.
6059

61-
### ExcludeAssets
60+
#### ExcludeAssets
6261
`<ExcluseAssets>` child element specifies what assets belonging to the package specified by parent `<PackageReference>` should not
6362
be consumed.
6463

6564
The element can contain one or more of the following values:
6665

67-
* Compile – are the contents of the lib folder available to compile against
68-
* Runtime – are the contents of the runtime folder distributed
69-
* ContentFiles – are the contents of the contentfiles folder used
70-
* Build – do the props/targets in the build folder get used
71-
* Native - are the contents from native assets copied to the output folder for runtime
72-
* Analyzers – do the analyzers get used
66+
* Compile – are the contents of the lib folder available to compile against
67+
* Runtime – are the contents of the runtime folder distributed
68+
* ContentFiles – are the contents of the contentfiles folder used
69+
* Build – do the props/targets in the build folder get used
70+
* Native are the contents from native assets copied to the output folder for runtime
71+
* Analyzers – do the analyzers get used
7372

7473
Alternatively, the element can contain:
7574

76-
* None – none of those things get used
77-
* All – all of those things get used.
75+
* None – none of those things get used
76+
* All – all of those things get used.
7877

79-
### PrivateAssets
78+
#### PrivateAssets
8079
`<PrivateAssets>` child element specifies what assets belonging to the package specified by parent `<PackageReference>` should be
8180
consumed but that they should not flow to the next project.
8281

83-
> **Note:** this is a new term for project.json/xproj `SupressParent` element.
82+
> [!NOTE]
83+
> This is a new term for project.json/xproj `SupressParent` element.
8484
8585
The element can contain one or more of the following values:
8686

87-
* Compile – are the contents of the lib folder available to compile against
88-
* Runtime – are the contents of the runtime folder distributed
89-
* ContentFiles – are the contents of the contentfiles folder used
90-
* Build – do the props/targets in the build folder get used
91-
* Native - are the contents from native assets copied to the output folder for runtime
92-
* Analyzers – do the analyzers get used
87+
* Compile – are the contents of the lib folder available to compile against
88+
* Runtime – are the contents of the runtime folder distributed
89+
* ContentFiles – are the contents of the contentfiles folder used
90+
* Build – do the props/targets in the build folder get used
91+
* Native are the contents from native assets copied to the output folder for runtime
92+
* Analyzers – do the analyzers get used
9393

9494
Alternatively, the element can contain:
9595

96-
* None – none of those things get used
97-
* All – all of those things get used.
96+
* None – none of those things get used
97+
* All – all of those things get used.
9898

99-
## DotnetCliToolReference
99+
### DotnetCliToolReference
100100
`<DotnetCliToolReference>` element specifies the CLI tool that the user wants restores in the context of the project. It is
101101
a replacement for the `tools` node in `project.json`.
102102

103-
### Version
103+
#### Version
104104
`<Version>` specifies the version of the package to restore. The element respect the rules of the NuGet versioning scheme.
105105

106-
## RuntimeIdentifiers
106+
### RuntimeIdentifiers
107107
`<RuntimeIdentifiers>` element allows specifying a semicolon-delimited list of [Runtime Identifiers](../../rid-catalog.md) for the project.
108108
These allow publishing self-contained deployments.
109109

docs/core/preview3/tools/dependencies.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,38 @@ ms.devlang: dotnet
1212
ms.assetid: 74b87cdb-a244-4c13-908c-539118bfeef9
1313
---
1414

15-
Managing dependencies in .NET Core Preview 3 tooling
16-
----------------------------------------------------
15+
# Managing dependencies in .NET Core Preview 3 tooling
1716

18-
# Overview
1917
With the move of .NET Core projects from project.json to csproj and MSBuild, a significant invesment also happened that resulted in unification of the project file and assets that allow tracking of depenencies. For .NET Core projects this is similar to what project.json did. There is no separate JSON or XML file that tracks NuGet dependencies. With this change, we've also introduced another type of *reference* into the csproj syntax called the `<PackageReference>`.
2018

2119
This document describes the new reference type. It also shows how to add a package dependency using this new reference type to your project.
2220

23-
# The new <PackageReference> element
21+
## The new <PackageReference> element
2422
The `<PackageReference>` has the following basic structure:
2523

2624
```xml
27-
<PackageReference Include="<Package_ID>">
25+
<PackageReference Include="PACKAGE_ID">
2826
<Version>PACKAGE_VERSION</Version>
2927
</PackageReference>
3028
```
3129

32-
If you are familiar with MSBuild, it will look familiar to the other [reference types]() that already exist. The key is the `Include` statement which specifies the package id that you wish to add to the project. The `<Version>` child element specified the version to get. The versions are specified as per [NuGet version rules](https://docs.nuget.org/ndocs/create-packages/dependency-versions#version-ranges).
30+
If you are familiar with MSBuild, it will look familiar to the other [reference types]() that already exist. The key is the `Include` statement which specifies the package id that you wish to add to the project. The `<Version>` child element specifies the version to get. The versions are specified as per [NuGet version rules](https://docs.nuget.org/ndocs/create-packages/dependency-versions#version-ranges).
3331

34-
> **Note:** if you are not faimilar with the overall `csproj` syntax, you can use the [MSBuild project reference documentation]() to get acquainted.
32+
> [!NOTE]
33+
> If you are not familiar with the overall `csproj` syntax, you can use the [MSBuild project reference documentation]() to get acquainted.
3534
3635
Adding a dependency that is available only in a specific target is done using conditions:
3736

3837
```xml
39-
<PackageReference Include="<Package_ID>" Condition="'$(TargetFramework)' == 'netcoreapp1.0'">
38+
<PackageReference Include="PACKAGE_ID" Condition="'$(TargetFramework)' == 'netcoreapp1.0'">
4039
<Version>PACKAGE_VERSION</Version>
4140
</PackageReference>
4241
```
4342

4443
The above means that the dependency will only be valid if the build is happening for that given target. The `$(TargetFramework)` in the condition is a MSBuild property that is being set in the project. For most common .NET Core applications, you will not need to do this.
4544

46-
# Adding a dependency to your project
47-
Adding a dependency to your project is straightforward. Here is an example of how to add `JSON.net` version `9.0.1` to your project. Of course, it is applicable to any other NuGet dependency.
45+
## Adding a dependency to your project
46+
Adding a dependency to your project is straightforward. Here is an example of how to add Json.NET version `9.0.1` to your project. Of course, it is applicable to any other NuGet dependency.
4847

4948
When you open your project file, you will see two or more `<ItemGroup>` nodes. You will notice that one of the nodes already has `<PackageReference>` elements in it. You can add your new dependency to this node, or create a new one; it is completely up to you as the result will be the same.
5049

@@ -90,7 +89,7 @@ The full project looks like this:
9089
</Project>
9190
```
9291

93-
# Removing a dependency from the project
92+
## Removing a dependency from the project
9493
Removing a dependency from the project file involves simply removing the `<PackageReference>` from the project file.
9594

9695

docs/core/preview3/tools/dotnet-build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dotnet-build -- Builds a project and all of its dependencies
2828

2929
The `dotnet build` command builds multiple source file from a source project and its dependencies into a binary.
3030
By default, the resulting binary is in Intermediate Language (IL) and has a DLL extension.
31-
`dotnet build` also drops a `\*.deps` file which outlines what the host needs to run the application.
31+
`dotnet build` also drops a `*.deps` file which outlines what the host needs to run the application.
3232

3333
Building requires the existence of an asset file (a file that lists all of the dependencies of your application), which
3434
means that you have to run [`dotnet restore`](dotnet-restore.md) prior to building your code.

docs/core/preview3/tools/dotnet-new.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ After this, the project is ready to be compiled and/or edited further.
3636

3737
Prints out a short help for the command.
3838

39-
`-l|--lang <C#|F#>`
39+
`-l|--lang C#`
4040

41-
Language of the project. Defaults to `C#`. Other valid values are `csharp`, `fsharp`, `cs` and `fs`.
41+
Language of the project. Defaults to `C#`. Other valid values are `csharp` and `cs`.
4242

4343
`-t|--type`
4444

@@ -50,10 +50,6 @@ Create a C# console application project in the current directory:
5050

5151
`dotnet new` or `dotnet new --lang c#`
5252

53-
Create an F# console application project in the current directory:
54-
55-
`dotnet new --lang f#`
56-
5753
Create a new ASP.NET Core C# application project in the current directory:
5854

59-
`dotnet new -t web`
55+
`dotnet new -t web`

docs/core/preview3/tools/dotnet-nuget-delete.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Deletes version 1.0 of package MyPackage:
7171

7272
Deletes version 1.0 of package MyPackage, not prompting user for credentials or other input:
7373

74-
`dotnet nuget delete MyPackage 1.0 --non-ìnteractive`
74+
`dotnet nuget delete MyPackage 1.0 --non-interactive`
7575

7676
Deletes version 1.0 of package MyPackage, specifying a custom config file *./config/My.Config*:
7777

docs/core/preview3/tools/dotnet-restore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Restore dependencies and tools for the project in the current directory:
8888

8989
Restore dependencies and tools for the `app1` project found in the given path:
9090

91-
`dotnet restore ~/projects/app1/app1.csproj``
91+
`dotnet restore ~/projects/app1/app1.csproj`
9292

9393
Restore the dependencies and tools for the project in the current directory using the file path provided as the fallback source:
9494

docs/core/preview3/tools/dotnet-test.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ Configuration under which to build. The default value is `Release`.
111111

112112
Directory in which to find the binaries to run.
113113

114+
`-f|--framework [FRAMEWORK]`
115+
114116
Looks for test binaries for a specific framework.
115117

116118
`-r|--runtime [RUNTIME_IDENTIFIER]`
@@ -133,7 +135,7 @@ Run the tests in the project in the current directory:
133135

134136
Run the tests in the test1 project:
135137

136-
`dotnet test /projects/test1/test1.csproj`
138+
`dotnet test ~/projects/test1/test1.csproj`
137139

138140
## See also
139141

docs/core/preview3/tools/extensibility.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ API, here is a console application's project file that uses that tool:
7575
</PackageReference>
7676
</ItemGroup>
7777

78-
<!-- The tools reference -->
79-
<ItemGroup>
78+
<!-- The tools reference -->
79+
<ItemGroup>
8080
<DotNetCliToolReference Include="dotnet-api-search">
81-
<Version></Version>
81+
<Version></Version>
8282
</DotNetCliToolReference>
83-
</ItemGroup>
83+
</ItemGroup>
8484

8585
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8686
</Project>

docs/core/preview3/tools/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ the [driver](#driver) section.
4848
The following commands are installed by default:
4949

5050
* [new](dotnet-new.md)
51+
* [migrate](dotnet-migrate.md)
5152
* [restore](dotnet-restore.md)
5253
* [run](dotnet-run.md)
5354
* [build](dotnet-build.md)
@@ -115,7 +116,8 @@ You can learn more about both of these in the [.NET Core application deployment]
115116
If you used Preview 2 tooling and project.json projects, you can consult the [dotnet migrate](dotnet-migrate.md) command docs
116117
to get acquainted with the command and how to migrate your project.
117118

118-
> **Note:** the `dotnet migrate` command currently does not migrate pre-preview 2 project.json files.
119+
> [!NOTE]
120+
> The `dotnet migrate` command currently does not migrate pre-preview 2 project.json files.
119121
120122
## Extensibility
121123
Of course, not every tool that you could use in your workflow will be part of the core CLI tools. However, .NET Core

0 commit comments

Comments
 (0)