# .NET 6.0.0 Preview 4

.NET 6.0.0 Preview 4 comprises:

* .NET Runtime 6.0.0-preview.4.21253.7
* ASP.NET Core 6.0.0-preview.4.21253.5
* .NET SDK 6.0.100-preview.4.21255.9
* Windowsdesktop 6.0.0-preview.4.21254.5

See the [Release Notes][release-notes] for details about what is included in this update.

## Docker

[.NET container images](https://hub.docker.com/_/microsoft-dotnet) have been updated for this release. [Staying safe with .NET containers](https://devblogs.microsoft.com/dotnet/staying-safe-with-dotnet-containers/) provides insight and guidance on managing container images, with respect to pedigree, provenance and CVE management.

## Install .NET on Linux

### Install using Snap

Because of the isolated environment, using Snap is the preferred way to install and try .NET Previews on [Linux distributions that support Snap](https://docs.snapcraft.io/installing-snapd/6735).

After configuring Snap on your system, run the following command to install the latest .NET SDK.

`sudo snap install dotnet-sdk --channel=6.0/beta --classic`

When .NET is installed using the Snap package, the default .NET command is `dotnet-sdk.dotnet`, as opposed to just `dotnet`. The benefit of the namespaced command is that it will not conflict with a globally installed .NET version you may have. This command can be aliased to `dotnet` with:

`sudo snap alias dotnet-sdk.dotnet dotnet`

**Note:** Some distributions require an additional step to enable access to the SSL certificate. If you experience SSL errors when running `dotnet restore`, see [.NET for Linux Distributions](../../../linux.md) for a possible resolution.

### Install using deb/rpm packages

Preview release installers are not available from the Microsoft package repositories. The steps below provide an easy way to install .NET 6 using your Distro package manager.

**Note:** `curl` must be available on the system before running the following steps. Once you have confirmed that `curl` is available, complete the steps to download and install the latest .NET 6 Preview SDK and Runtime.

1. Create a directory to use for the download location and change into that directory. For example `mkdir $HOME/dotnet_install && cd $HOME/dotnet_install`
2. Run `curl -L https://aka.ms/install-dotnet-preview -o install-dotnet-preview.sh`
3. Run the script with `sudo bash install-dotnet-preview.sh`

Here's what the script does.

* Detects the distribution and version. The script supports platforms and versions listed in [.NET 6.0 - Supported OS versions](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md).
* Determines if additional system dependencies or utilities are needed to successfully complete and install them. For example `tar` is used to unpack that installer packages.
* Downloads the tar.gz containing the .NET preview installer packages for the detected distribution.
* Downloads the system dependency installer, if needed.
* Expands the tar.gz into ./dotnet_pacakges
* Attempts to install the contents of ./dotnet_packages using `rpm` or `dpkg`, as appropriate, for the detected distribution.

### Installation from a binary archive

Installing from the packages detailed above is recommended or you can install from binary archive, if that better suits your needs. When using binary archives to install, the contents must be extracted to a user location such as `$HOME/dotnet`, a symbolic link created for `dotnet` and a few dependencies installed. Dependency requirements can be seen in the [Linux System Prerequisites](../linux-packages.md) document.

```bash
mkdir -p $HOME/dotnet && tar zxf dotnet.tar.gz -C $HOME/dotnet
export PATH=$PATH:$HOME/dotnet
```

## .NET Runtime-only installation

If only the .NET Runtime is needed, install `dotnet-runtime-6.0` using your package manager. If you also need ASP.NET Core functionality, installing `aspnetcore-runtime-6.0` will install both the ASP Runtime and .NET Runtime.

## Windows Server Hosting

If you are looking to host stand-alone apps on Servers, the following installer can be used on Windows systems.

### Windows

You can download the Windows Server Hosting installer and run the following command from an Administrator command prompt:

* [dotnet-hosting-6.0.0-preview.4.exe][dotnet-hosting-win.exe]

This will install the ASP.NET Core Module for IIS.

## Install .NET Multi-platform App UI Workloads

### Downloads

* Android: [[Windows][android-win]] [[Mac][android-mac]]
* iOS: [[Windows][ios-win]] [[Mac][ios-mac]]
* Mac Catalyst (UIKit): [[Mac][maccatalyst-mac]]
* Mac (Cocoa/AppKit): [[Mac][maccocoa-mac]]

See the [net6-mobile-samples](https://github.com/dotnet/net6-mobile-samples/) repo for sample projects and further details about getting started.

Projects will need to add additional NuGet feeds. An example `NuGet.config` file would be:

```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <!-- ensure only the sources defined below are used -->
    <add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
    <add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
  </packageSources>
</configuration>
```

### Android

Prerequisites:

* Install .NET 6.0.0 Preview 4
* You will need the Android SDK installed as well as `Android SDK Platform 30`. One way to acquire this is to install the Xamarin workload in the Visual Studio installer. You can manage Android SDKs from `Tools > Android > Android SDK Manager` from within Visual Studio.

### iOS and Mac Catalyst

Prerequisites:

* Install .NET 6.0.0 Preview 4
* Xcode 12.5

[android-mac]: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/net6/4716293/6.0.1xx-preview4/a09fa1e93a94c7ee9f759c840ed7a5829d0e9152/Microsoft.NET.Workload.Android-11.0.200-preview.4.245.pkg
[android-win]: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/net6/4716293/6.0.1xx-preview4/a09fa1e93a94c7ee9f759c840ed7a5829d0e9152/Microsoft.NET.Workload.Android.11.0.200.245.msi
[ios-mac]: https://bosstoragemirror.azureedge.net/wrench/6.0.1xx-preview4/05cf7f73ec60d360f1a6391f1c047d4e8957203a/4731910/package/notarized/Microsoft.iOS.Bundle.14.5.100-preview.4.638.pkg
[ios-win]: https://bosstoragemirror.azureedge.net/wrench/6.0.1xx-preview4/05cf7f73ec60d360f1a6391f1c047d4e8957203a/4731910/package/Microsoft.NET.Workload.iOS.14.5.100-preview.4.638.msi
[maccatalyst-mac]: https://bosstoragemirror.azureedge.net/wrench/6.0.1xx-preview4/05cf7f73ec60d360f1a6391f1c047d4e8957203a/4731910/package/notarized/Microsoft.MacCatalyst.Bundle.14.5.100-preview.4.638.pkg
[maccocoa-mac]: https://bosstoragemirror.azureedge.net/wrench/6.0.1xx-preview4/05cf7f73ec60d360f1a6391f1c047d4e8957203a/4731910/package/notarized/Microsoft.macOS.Bundle.11.3.100-preview.4.638.pkg

[blob-runtime]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/
[blob-sdk]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/
[release-notes]: 6.0.0-preview.4.md

[checksums-runtime]: https://dotnetcli.blob.core.windows.net/dotnet/checksums/6.0.0-preview.4-sha.txt
[checksums-sdk]: https://dotnetcli.blob.core.windows.net/dotnet/checksums/6.0.0-preview.4-sha.txt

[linux-install]: https://learn.microsoft.com/dotnet/core/install/linux

[dotnet-blog]: https://devblogs.microsoft.com/dotnet/announcing-net-core-5-0-preview-4/
[aspnet-blog]: https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-5-0-preview-4/
[ef-blog]: https://devblogs.microsoft.com/dotnet/

[aspnet_bugs]: https://github.com/aspnet/AspNetCore/issues?q=is%3Aissue+milestone%3A6.0.0-preview4+label%3ADone+label%3Abug
[aspnet_features]: https://github.com/aspnet/AspNetCore/issues?q=is%3Aissue+milestone%3A6.0.0-preview4+label%3ADone+label%3Aenhancement
[runtime_bugs]: https://github.com/dotnet/runtime/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A5.0+label%3Abug+
[runtime_features]: https://github.com/dotnet/runtime/issues?q=is%3Aissue+milestone%3A5.0+label%3Aenhancement

[dotnet-hosting-win.exe]: https://download.visualstudio.microsoft.com/download/pr/2728666c-860b-4a78-ba42-8ec7b2167d42/72b9c82be95a013e2c15a1fc182e2fc4/dotnet-hosting-6.0.0-preview.4.21253.5-win.exe
