Skip to content
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
5 changes: 5 additions & 0 deletions docs/core/compatibility/3.1-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ If you're migrating from version 3.1 of .NET Core, ASP.NET Core, or EF Core to v

## Windows Forms

- [Removed status bar controls](#removed-status-bar-controls)
- [WinForms APIs now throw ArgumentNullException](#winforms-apis-now-throw-argumentnullexception)

[!INCLUDE [winforms-deprecated-controls](../../../includes/core-changes/windowsforms/5.0/winforms-deprecated-controls.md)]

***

[!INCLUDE [null-args-cause-argumentnullexception](../../../includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md)]

***
5 changes: 5 additions & 0 deletions docs/core/compatibility/winforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The following breaking changes are documented on this page:

| Breaking change | Version introduced |
| - | :-: |
| [Removed status bar controls](#removed-status-bar-controls) | 5.0 |
| [WinForms APIs now throw ArgumentNullException](#winforms-apis-now-throw-argumentnullexception) | 5.0 |
| [Removed controls](#removed-controls) | 3.1 |
| [CellFormatting event not raised if tooltip is shown](#cellformatting-event-not-raised-if-tooltip-is-shown) | 3.1 |
Expand All @@ -30,6 +31,10 @@ The following breaking changes are documented on this page:

## .NET 5.0

[!INCLUDE [winforms-deprecated-controls](../../../includes/core-changes/windowsforms/5.0/winforms-deprecated-controls.md)]

***

[!INCLUDE [null-args-cause-argumentnullexception](../../../includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md)]

***
Expand Down
54 changes: 31 additions & 23 deletions docs/core/docker/build-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ myapp.deps.json myapp.dll myapp.pdb myapp.runtimeconfig.json

The *Dockerfile* file is used by the `docker build` command to create a container image. This file is a text file named *Dockerfile* that doesn't have an extension.

In your terminal, navigate up a directory to the working folder you created at the start. Create a file named *Dockerfile* in your working folder and open it in a text editor. Depending on the type of application you're going to containerize, you'll choose either the ASP.NET Core runtime or the .NET Core runtime. When in doubt, choose the ASP.NET Core runtime, which includes the .NET Core runtime. This tutorial will use the ASP.NET Core runtime image, but the application created in the previous sections is an .NET Core application.
In your terminal, navigate back one directory to the working folder you created at the start. Create a file named *Dockerfile* in your working folder and open it in a text editor. Depending on the type of application you're going to containerize, you'll choose either the ASP.NET Core runtime or the .NET Core runtime. When in doubt, choose the ASP.NET Core runtime, which includes the .NET Core runtime. This tutorial will use the ASP.NET Core runtime image, but the application created in the previous sections is an .NET Core application.

- ASP.NET Core runtime

Expand Down Expand Up @@ -214,42 +214,50 @@ Docker will process each line in the *Dockerfile*. The `.` in the `docker build`
```console
> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
myimage latest 38db0eb8f648 4 weeks ago 346MB
mcr.microsoft.com/dotnet/core/aspnet 3.1 38db0eb8f648 4 weeks ago 346MB
myimage latest 54240314fe71 4 weeks ago 346MB
mcr.microsoft.com/dotnet/core/aspnet 3.1 54240314fe71 4 weeks ago 346MB
```

Notice that the two images share the same **IMAGE ID** value. The value is the same between both images because the only command in the *Dockerfile* was to base the new image on an existing image. Let's add two commands to the *Dockerfile*. Each command creates a new image layer with the final command representing the image the **myimage** repository entry points to.

```dockerfile
COPY app/bin/Release/netcoreapp3.1/publish/ app/

ENTRYPOINT ["dotnet", "app/myapp.dll"]
WORKDIR /app

ENTRYPOINT ["dotnet", "myapp.dll"]
```

The `COPY` command tells Docker to copy the specified folder on your computer to a folder in the container. In this example, the *publish* folder is copied to a folder named *app* in the container.

The `WORKDIR` command changes the **current directory** inside of the container to *app*.

The next command, `ENTRYPOINT`, tells Docker to configure the container to run as an executable. When the container starts, the `ENTRYPOINT` command runs. When this command ends, the container will automatically stop.

From your terminal, run `docker build -t myimage -f Dockerfile .` and when that command finishes, run `docker images`.

```console
> docker build -t myimage -f Dockerfile .
Sending build context to Docker daemon 1.624MB
Step 1/3 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
---> 38db0eb8f648
Step 2/3 : COPY app/bin/Release/netcoreapp3.1/publish/ app/
---> 37873673e468
Step 3/3 : ENTRYPOINT ["dotnet", "app/myapp.dll"]
---> Running in d8deb7b3aa9e
Removing intermediate container d8deb7b3aa9e
---> 0d602ca35c1d
Successfully built 0d602ca35c1d
Sending build context to Docker daemon 1.121MB
Step 1/4 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
---> 54240314fe71
Step 2/4 : COPY app/bin/Release/netcoreapp3.1/publish/ app/
---> 1e05ea8b3ef5
Step 3/4 : WORKDIR /app
---> Running in 8c8f710e6292
Removing intermediate container 8c8f710e6292
---> 31575599f7dc
Step 4/4 : ENTRYPOINT ["dotnet", "myapp.dll"]
---> Running in 93851322fb76
Removing intermediate container 93851322fb76
---> e496e8b22d02
Successfully built e496e8b22d02
Successfully tagged myimage:latest

> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
myimage latest 0d602ca35c1d 4 seconds ago 346MB
mcr.microsoft.com/dotnet/core/aspnet 3.1 38db0eb8f648 4 weeks ago 346MB
myimage latest e496e8b22d02 4 seconds ago 346MB
mcr.microsoft.com/dotnet/core/aspnet 3.1 54240314fe71 4 weeks ago 346MB
```

Each command in the *Dockerfile* generated a layer and created an **IMAGE ID**. The final **IMAGE ID** (yours will be different) is **ddcc6646461b** and next you'll create a container based on this image.
Expand All @@ -260,15 +268,15 @@ Now that you have an image that contains your app, you can create a container. Y

```console
> docker create myimage
ceda87b219a4e55e9ad5d833ee1a7ea4da21b5ea7ce5a7d08f3051152e784944
9222af24353f42bab6c13e01a0a64ef2c915cad27bdc46ffa32380581de11e91
```

The `docker create` command from above will create a container based on the **myimage** image. The output of that command shows you the **CONTAINER ID** (yours will be different) of the created container. To see a list of *all* containers, use the `docker ps -a` command:

```console
> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ceda87b219a4 myimage "dotnet app/myapp.dll" 4 seconds ago Created gallant_lehmann
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9222af24353f myimage "dotnet myapp.dll" 4 seconds ago Created gallant_lehmann
```

### Manage the container
Expand All @@ -282,8 +290,8 @@ The following example uses the `docker start` command to start the container, an
gallant_lehmann

> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ceda87b219a4 myimage "dotnet app/myapp.dll" 7 minutes ago Up 8 seconds gallant_lehmann
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9222af24353f myimage "dotnet myapp.dll" 7 minutes ago Up 8 seconds gallant_lehmann
```

Similarly, the `docker stop` command will stop the container. The following example uses the `docker stop` command to stop the container, and then uses the `docker ps` command to show that no containers are running:
Expand Down Expand Up @@ -331,8 +339,8 @@ The following example lists all containers. It then uses the `docker rm` command

```console
> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ceda87b219a4 myimage "dotnet app/myapp.dll" 19 minutes ago Exited gallant_lehmann
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9222af24353f myimage "dotnet myapp.dll" 19 minutes ago Exited gallant_lehmann

> docker rm gallant_lehmann
gallant_lehmann
Expand Down
6 changes: 5 additions & 1 deletion docs/core/install/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ For more information about .NET Core 2.1 supported operating systems, distributi

<!-- markdownlint-disable MD001 -->

### Windows 7 / Vista / 8.1 / Server 2008 R2
### <a name="additional-deps"></a> Windows 7 / Vista / 8.1 / Server 2008 R2 / Server 2012 R2

Additional dependencies are required if you're installing the .NET SDK or runtime on the following Windows versions:

Expand All @@ -111,6 +111,10 @@ The requirements above are also required if you come across one of the following
>
> \- or -
>
> The program can't start because *api-ms-win-cor-timezone-l1-1-0.dll* is missing from your computer. Try reinstalling the program to fix this problem.
>
> \- or -
>
> The library *hostfxr.dll* was found, but loading it from *C:\\\<path_to_app>\\hostfxr.dll* failed.

::: zone-end
Expand Down
1 change: 1 addition & 0 deletions docs/core/install/includes/package-manager-switcher.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

> [!div class="op_single_selector"]
>
> - [Ubuntu 20.04 - x64](../linux-package-manager-ubuntu-2004.md)
> - [Ubuntu 19.10 - x64](../linux-package-manager-ubuntu-1910.md)
> - [Ubuntu 19.04 - x64](../linux-package-manager-ubuntu-1904.md)
> - [Ubuntu 18.04 - x64](../linux-package-manager-ubuntu-1804.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/core/install/linux-package-manager-ubuntu-1910.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ If that doesn't work, you can run a manual install with the following commands.

```bash
sudo apt-get install -y gpg
wget O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
wget -O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/ubuntu/19.10/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
Expand Down
111 changes: 111 additions & 0 deletions docs/core/install/linux-package-manager-ubuntu-2004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: Install .NET Core on Ubuntu 20.04 package manager - .NET Core
description: Use a package manager to install .NET Core SDK and runtime on Ubuntu 20.04.
author: thraka
ms.author: adegeo
ms.date: 04/15/2020
---

# Ubuntu 20.04 Package Manager - Install .NET Core

[!INCLUDE [package-manager-switcher](./includes/package-manager-switcher.md)]

This article describes how to use a package manager to install .NET Core on Ubuntu 20.04.

[!INCLUDE [package-manager-intro-sdk-vs-runtime](includes/package-manager-intro-sdk-vs-runtime.md)]

## Add Microsoft repository key and feed

Before installing .NET, you'll need to:

- Add the Microsoft package signing key to the list of trusted keys.
- Add the repository to the package manager.
- Install required dependencies.

This only needs to be done once per machine.

Open a terminal and run the following commands.

```bash
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
```

## Install the .NET Core SDK

Update the products available for installation, then install the .NET Core SDK. In your terminal, run the following commands.

```bash
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
```

> [!IMPORTANT]
> If you receive an error message similar to **Unable to locate package dotnet-sdk-3.1**, see the [Troubleshoot the package manager](#troubleshoot-the-package-manager) section.

## Install the ASP.NET Core runtime

Update the products available for installation, then install the ASP.NET Core runtime. In your terminal, run the following commands.

```bash
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install aspnetcore-runtime-3.1
```

> [!IMPORTANT]
> If you receive an error message similar to **Unable to locate package aspnetcore-runtime-3.1**, see the [Troubleshoot the package manager](#troubleshoot-the-package-manager) section.

## Install the .NET Core runtime

Update the products available for installation, then install the .NET Core runtime. In your terminal, run the following commands.

```bash
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-runtime-3.1
```

> [!IMPORTANT]
> If you receive an error message similar to **Unable to locate package dotnet-runtime-3.1**, see the [Troubleshoot the package manager](#troubleshoot-the-package-manager) section.

## How to install other versions

[!INCLUDE [package-manager-switcher](./includes/package-manager-heading-hack-pkgname.md)]

## Troubleshoot the package manager

This section provides information on common errors you may get while using the package manager to install .NET Core.

### Unable to locate

If you receive an error message similar to **Unable to locate package {the .NET Core package}**, run the following commands.

```bash
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install {the .NET Core package}
```

If that doesn't work, you can run a manual install with the following commands.

```bash
sudo apt-get install -y gpg
wget -O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/ubuntu/20.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install {the .NET Core package}
```

### Failed to fetch

[!INCLUDE [package-manager-failed-to-fetch-deb](includes/package-manager-failed-to-fetch-deb.md)]
2 changes: 2 additions & 0 deletions docs/core/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
href: install/how-to-detect-installed-versions.md
- name: Linux package managers
items:
- name: Ubuntu 20.04
href: install/linux-package-manager-ubuntu-2004.md
- name: Ubuntu 19.10
href: install/linux-package-manager-ubuntu-1910.md
- name: Ubuntu 19.04
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/operators/await.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ms.assetid: 50725c24-ac76-4ca7-bca1-dd57642ffedb
---
# await operator (C# reference)

The `await` operator suspends evaluation of the enclosing [async](../keywords/async.md) method until the asynchronous operation represented by its operand completes. When the asynchronous operation completes, the `await` operator returns the result of the operation, if any. When the `await` operator is applied to the operand that represents already completed operation, it returns the result of the operation immediately without suspension of the enclosing method. The `await` operator doesn't block the thread that evaluates the async method. When the `await` operator suspends the enclosing async method, the control returns to the caller of the method.
The `await` operator suspends evaluation of the enclosing [async](../keywords/async.md) method until the asynchronous operation represented by its operand completes. When the asynchronous operation completes, the `await` operator returns the result of the operation, if any. When the `await` operator is applied to the operand that represents an already completed operation, it returns the result of the operation immediately without suspension of the enclosing method. The `await` operator doesn't block the thread that evaluates the async method. When the `await` operator suspends the enclosing async method, the control returns to the caller of the method.

In the following example, the <xref:System.Net.Http.HttpClient.GetByteArrayAsync%2A?displayProperty=nameWithType> method returns the `Task<byte[]>` instance, which represents an asynchronous operation that produces a byte array when it completes. Until the operation completes, the `await` operator suspends the `DownloadDocsMainPageAsync` method. When `DownloadDocsMainPageAsync` gets suspended, control is returned to the `Main` method, which is the caller of `DownloadDocsMainPageAsync`. The `Main` method executes until it needs the result of the asynchronous operation performed by the `DownloadDocsMainPageAsync` method. When <xref:System.Net.Http.HttpClient.GetByteArrayAsync%2A> gets all the bytes, the rest of the `DownloadDocsMainPageAsync` method is evaluated. After that, the rest of the `Main` method is evaluated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The preceding sample shows the basic elements of a switch expression:
- The *range expression*: The preceding example uses the variable `direction` as the range expression.
- The *switch expression arms*: Each switch expression arm contains a *pattern*, an optional *case guard*, the `=>` token, and an *expression*.

The result of the *switch expression* is the value of the expression of the first *switch expression arm* whose *pattern* matches the *range expression* and whose *cause guard*, if present, evaluates to `true`. The *expression* on the right of the `=>` token can't be an expression statement.
The result of the *switch expression* is the value of the expression of the first *switch expression arm* whose *pattern* matches the *range expression* and whose *case guard*, if present, evaluates to `true`. The *expression* on the right of the `=>` token can't be an expression statement.

The *switch expression arms* are evaluated in text order. The compiler issues an error when a lower *switch expression arm* can't be chosen because a higher *switch expression arm* matches all its values.

Expand Down
Loading