Skip to content

Changed TFMs to netcoreapp2.1 #7577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/core/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Typically, rather than including packages in your projects on a package-by-packa

Metapackages are a NuGet package convention for describing a set of packages that are meaningful together. They represent this set of packages by making them dependencies. They can optionally establish a framework for this set of packages by specifying a framework.

Previous versions of the .NET Core tools (both project.json and csproj-based tools) by default specified both a framework and a metapackage. Currently, however, the metapackage is implicitly referenced by the target framework, so that each metapackage is tied to a target framework. For example, the `netstandard1.6` framework references the NetStandard.Library version 1.6.0 metapackage. Similarly, the `netcoreapp1.1` framework references the Microsoft.NETCore.App Version 1.1.0 metapackage. For more information, see [Implicit metapackage package reference in the .NET Core SDK](https://github.com/dotnet/core/blob/master/release-notes/1.0/sdk/1.0-rc3-implicit-package-refs.md).
Previous versions of the .NET Core tools (both project.json and csproj-based tools) by default specified both a framework and a metapackage. Currently, however, the metapackage is implicitly referenced by the target framework, so that each metapackage is tied to a target framework. For example, the `netstandard1.6` framework references the NetStandard.Library version 1.6.0 metapackage. Similarly, the `netcoreapp2.1` framework references the Microsoft.NETCore.App Version 2.1.0 metapackage. For more information, see [Implicit metapackage package reference in the .NET Core SDK](https://github.com/dotnet/core/blob/master/release-notes/1.0/sdk/1.0-rc3-implicit-package-refs.md).

Targeting a framework and implicitly referencing a metapackage means that you in effect are adding a reference to each of its dependent packages as a single gesture. That makes all of the libraries in those packages available for IntelliSense (or similar experience) and for publishing your app.

Expand Down
1 change: 1 addition & 0 deletions docs/core/porting/third-party-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ netstandard2.0
netcoreapp1.0
netcoreapp1.1
netcoreapp2.0
netcoreapp2.1
portable-net45-win8
portable-win8-wpa8
portable-net451-win81
Expand Down
8 changes: 4 additions & 4 deletions docs/core/tools/csproj.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Metapackages are implicitly referenced based on the target framework(s) specifie

```xml
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
```

```xml
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net462</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net462</TargetFrameworks>
</PropertyGroup>
```

Expand Down Expand Up @@ -167,10 +167,10 @@ The following example provides the fallbacks for all targets in your project:
</PackageTargetFallback >
```

The following example specifies the fallbacks only for the `netcoreapp1.0` target:
The following example specifies the fallbacks only for the `netcoreapp2.1` target:

```xml
<PackageTargetFallback Condition="'$(TargetFramework)'=='netcoreapp1.0'">
<PackageTargetFallback Condition="'$(TargetFramework)'=='netcoreapp2.1'">
$(PackageTargetFallback);portable-net45+win8+wpa81+wp8
</PackageTargetFallback >
```
Expand Down
4 changes: 2 additions & 2 deletions docs/core/tools/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If you are familiar with MSBuild, it will look familiar to the other reference t
Adding a dependency that is available only in a specific target is done using conditions like in the following example:

```xml
<PackageReference Include="PACKAGE_ID" Version="PACKAGE_VERSION" Condition="'$(TargetFramework)' == 'netcoreapp1.0'" />
<PackageReference Include="PACKAGE_ID" Version="PACKAGE_VERSION" Condition="'$(TargetFramework)' == 'netcoreapp2.1'" />
```

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.
Expand All @@ -51,7 +51,7 @@ The full project looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion docs/core/tools/dotnet-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dotnet run [-h|--help]

The `dotnet run` command provides a convenient option to run your application from the source code with one command. It's useful for fast iterative development from the command line. The command depends on the [`dotnet build`](dotnet-build.md) command to build the code. Any requirements for the build, such as that the project must be restored first, apply to `dotnet run` as well.

Output files are written into the default location, which is `bin/<configuration>/<target>`. For example if you have a `netcoreapp1.0` application and you run `dotnet run`, the output is placed in `bin/Debug/netcoreapp1.0`. Files are overwritten as needed. Temporary files are placed in the `obj` directory.
Output files are written into the default location, which is `bin/<configuration>/<target>`. For example if you have a `netcoreapp2.1` application and you run `dotnet run`, the output is placed in `bin/Debug/netcoreapp2.1`. Files are overwritten as needed. Temporary files are placed in the `obj` directory.

If the project specifies multiple frameworks, executing `dotnet run` results in an error unless the `-f|--framework <FRAMEWORK>` option is used to specify the framework.

Expand Down
2 changes: 1 addition & 1 deletion docs/core/tools/extensibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ API, here is a console application's project file that uses that tool:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<!-- The tools reference -->
Expand Down
55 changes: 19 additions & 36 deletions docs/core/tutorials/testing-with-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Organizing and testing projects with the .NET Core command line
description: This tutorial explains how to organize and test .NET Core projects from the command line.
author: cartermp
ms.author: mairaw
ms.date: 05/16/2017
ms.date: 09/10/2018
---
# Organizing and testing projects with the .NET Core command line

Expand Down Expand Up @@ -78,7 +78,7 @@ Create the following folder structure with file content indicated:

[!code-xml[NewTypes csproj](../../../samples/core/console-apps/NewTypesMsBuild/src/NewTypes/NewTypes.csproj)]

Execute the following commands:
Execute the following command:

```console
dotnet run
Expand Down Expand Up @@ -183,47 +183,33 @@ Start in the *test/NewTypesTests* directory. Restore the test project with the [


As expected, testing fails, and the console displays the following output:

```
Test run for C:\NewTypesMsBuild\test\NewTypesTests\bin\Debug\netcoreapp1.1\NewTypesTests.dll(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Test run for c:\Users\ronpet\repos\samples\core\console-apps\NewTypesMsBuild\test\NewTypesTests\bin\Debug\netcoreapp2.1\NewTypesTests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.8.0
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:00.7271827] Discovering: NewTypesTests
[xUnit.net 00:00:00.8258687] Discovered: NewTypesTests
[xUnit.net 00:00:00.8663545] Starting: NewTypesTests
[xUnit.net 00:00:01.0109236] PetTests.CatTalkToOwnerReturnsMeow [FAIL]
[xUnit.net 00:00:01.0119107] Assert.NotEqual() Failure
[xUnit.net 00:00:01.0120278] Expected: Not "Meow!"
[xUnit.net 00:00:01.0120968] Actual: "Meow!"
[xUnit.net 00:00:01.0130500] Stack Trace:
[xUnit.net 00:00:01.0141240] C:\NewTypesMsBuild\test\NewTypesTests\PetTests.cs(22,0): at PetTests.CatTalkToOwnerReturnsMeow()
[xUnit.net 00:00:01.0272364] PetTests.DogTalkToOwnerReturnsWoof [FAIL]
[xUnit.net 00:00:01.0273649] Assert.NotEqual() Failure
[xUnit.net 00:00:01.0274166] Expected: Not "Woof!"
[xUnit.net 00:00:01.0274690] Actual: "Woof!"
[xUnit.net 00:00:01.0275264] Stack Trace:
[xUnit.net 00:00:01.0275960] C:\NewTypesMsBuild\test\NewTypesTests\PetTests.cs(13,0): at PetTests.DogTalkToOwnerReturnsWoof()
[xUnit.net 00:00:01.0294509] Finished: NewTypesTests
Failed PetTests.CatTalkToOwnerReturnsMeow
Error Message:
Assert.NotEqual() Failure
Expected: Not "Meow!"
Actual: "Meow!"
Stack Trace:
at PetTests.CatTalkToOwnerReturnsMeow() in C:\NewTypesMsBuild\test\NewTypesTests\PetTests.cs:line 22
[xUnit.net 00:00:00.77] PetTests.DogTalkToOwnerReturnsWoof [FAIL]
[xUnit.net 00:00:00.78] PetTests.CatTalkToOwnerReturnsMeow [FAIL]
Failed PetTests.DogTalkToOwnerReturnsWoof
Error Message:
Assert.NotEqual() Failure
Expected: Not "Woof!"
Actual: "Woof!"
Stack Trace:
at PetTests.DogTalkToOwnerReturnsWoof() in C:\NewTypesMsBuild\test\NewTypesTests\PetTests.cs:line 13
at PetTests.DogTalkToOwnerReturnsWoof() in c:\Users\ronpet\repos\samples\core\console-apps\NewTypesMsBuild\test\NewTypesTests\PetTests.cs:line 13
Failed PetTests.CatTalkToOwnerReturnsMeow
Error Message:
Assert.NotEqual() Failure
Expected: Not "Meow!"
Actual: "Meow!"
Stack Trace:
at PetTests.CatTalkToOwnerReturnsMeow() in c:\Users\ronpet\repos\samples\core\console-apps\NewTypesMsBuild\test\NewTypesTests\PetTests.cs:line 22

Total tests: 2. Passed: 0. Failed: 2. Skipped: 0.
Test Run Failed.
Test execution time: 2.1371 Seconds
Test execution time: 1.7000 Seconds
```

Change the assertions of your tests from `Assert.NotEqual` to `Assert.Equal`:
Expand All @@ -233,18 +219,15 @@ Change the assertions of your tests from `Assert.NotEqual` to `Assert.Equal`:
Re-run the tests with the `dotnet test` command and obtain the following output:

```
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Test run for c:\Users\ronpet\repos\samples\core\console-apps\NewTypesMsBuild\test\NewTypesTests\bin\Debug\netcoreapp2.1\NewTypesTests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.8.0
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:01.3882374] Discovering: NewTypesTests
[xUnit.net 00:00:01.4767970] Discovered: NewTypesTests
[xUnit.net 00:00:01.5157667] Starting: NewTypesTests
[xUnit.net 00:00:01.6408870] Finished: NewTypesTests

Total tests: 2. Passed: 2. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1.6634 Seconds
Test execution time: 1.6029 Seconds
```

Testing passes. The pet types' methods return the correct values when talking to the owner.
Expand Down
21 changes: 9 additions & 12 deletions docs/core/tutorials/using-with-xplat-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Getting started with .NET Core using the CLI
description: A step-by-step tutorial showing how to get started with .NET Core on Windows, Linux, or macOS using the .NET Core command-line interface (CLI).
author: cartermp
ms.author: mairaw
ms.date: 03/08/2017
ms.date: 09/10/2018
ms.technology: dotnet-cli
---
# Getting started with .NET Core on Windows/Linux/macOS using the command line
Expand All @@ -14,7 +14,7 @@ If you're unfamiliar with the .NET Core CLI toolset, read the [.NET Core SDK ove

## Prerequisites

- [.NET Core SDK 1.0](https://www.microsoft.com/net/download/core).
- [.NET Core SDK 2.1](https://www.microsoft.com/net/download/core).
- A text editor or code editor of your choice.

## Hello, Console App!
Expand All @@ -25,7 +25,6 @@ Open a command prompt and create a folder named *Hello*. Navigate to the folder

```console
$ dotnet new console
$ dotnet restore
$ dotnet run
```

Expand Down Expand Up @@ -54,13 +53,12 @@ Let's do a quick walkthrough:

[!INCLUDE[DotNet Restore Note](~/includes/dotnet-restore-note.md)]

2. `$ dotnet restore`
`dotnet new` calls [`dotnet restore`](../tools/dotnet-restore.md) implicitly. `dotnet restore` calls into [NuGet](https://www.nuget.org/) (.NET package manager) to restore the tree of dependencies. NuGet analyzes the *Hello.csproj* file, downloads the dependencies defined in the file (or grabs them from a cache on your machine), and writes the *obj/project.assets.json* file, which is necessary to compile and run the sample.

> [!IMPORTANT]
> If you're using a .NET Core 1.x version of the SDK, you'll have to call `dotnet restore` yourself after calling `dotnet new`.

[`dotnet restore`](../tools/dotnet-restore.md) calls into [NuGet](https://www.nuget.org/) (.NET package manager) to restore the tree of dependencies. NuGet analyzes the *Hello.csproj* file, downloads the dependencies stated in the file (or grabs them from a cache on your machine), and writes the *obj/project.assets.json* file. The *project.assets.json* file is necessary to be able to compile and run.

The *project.assets.json* file is a persisted and complete set of the graph of NuGet dependencies and other information describing an app. This file is read by other tools, such as [`dotnet build`](../tools/dotnet-build.md) and [`dotnet run`](../tools/dotnet-run.md), enabling them to process the source code with a correct set of NuGet dependencies and binding resolutions.

3. `$ dotnet run`
2. `$ dotnet run`

[`dotnet run`](../tools/dotnet-run.md) calls [`dotnet build`](../tools/dotnet-build.md) to ensure that the build targets have been built, and then calls `dotnet <assembly.dll>` to run the target application.

Expand All @@ -69,10 +67,9 @@ Let's do a quick walkthrough:
Hello World!
```

Alternatively, you can also execute [`dotnet build`](../tools/dotnet-build.md) to compile the code without running the build console applications. This results in a compiled application as a DLL file that can be run with `dotnet bin\Debug\netcoreapp1.0\Hello.dll` on Windows (use `/` for non-Windows systems). You may also specify arguments to the application as you'll see later on the topic.

Alternatively, you can also execute [`dotnet build`](../tools/dotnet-build.md) to compile the code without running the build console applications. This results in a compiled application as a DLL file that can be run with `dotnet bin\Debug\netcoreapp2.1\Hello.dll` on Windows (use `/` for non-Windows systems). You may also specify arguments to the application as you'll see later on the topic.
```console
$ dotnet bin\Debug\netcoreapp1.0\Hello.dll
$ dotnet bin\Debug\netcoreapp2.1\Hello.dll
Hello World!
```

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/codedoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can generate the XML file at compile time by doing one of the following:
You can also specify the exact absolute or relative path and name of the XML file. The following example generates the XML file in the same directory as the debug version of an application:

```xml
<DocumentationFile>bin\Debug\netcoreapp1.0\App.xml</DocumentationFile>
<DocumentationFile>bin\Debug\netcoreapp2.1\App.xml</DocumentationFile>
```

- If you are developing an application using Visual Studio, right-click on the project and select **Properties**. In the properties dialog, select the **Build** tab, and check **XML documentation file**. You can also change the location to which the compiler writes the file.
Expand Down