Install .NET on Windows

  • Install on Windows
  • Install on macOS
  • Install on Linux

In this commodity, you lot'll acquire how to install .NET on Windows. .NET is made up of the runtime and the SDK. The runtime is used to run a .NET app and may or may not exist included with the app. The SDK is used to create .NET apps and libraries. The .Cyberspace runtime is always installed with the SDK.

The latest version of .NET is 6.

Supported releases

The post-obit table is a list of currently supported .Net releases and the versions of Windows they're supported on. These versions remain supported until either the version of .Net reaches end-of-support or the version of Windows reaches end-of-life.

Windows x versions end-of-service dates are segmented by edition. Only Dwelling, Pro, Pro Education, and Pro for Workstations editions are considered in the following table. Check the Windows lifecycle fact canvas for specific details.

Tip

A + symbol represents the minimum version.

Operating Arrangement .Internet Core three.1 .Internet v .NET 6
Windows 11 ✔️ ✔️
Windows Server 2022 ✔️ ✔️
Windows 10 Version 21H1 ✔️ ✔️
Windows 10 / Windows Server, Version 20H2 ✔️ ✔️
Windows 10 / Windows Server, Version 2004 ✔️ ✔️
Windows 10 / Windows Server, Version 1909 ✔️ ✔️
Windows ten / Windows Server, Version 1903 ✔️ ✔️
Windows x, Version 1809 ✔️ ✔️
Windows 10, Version 1803 ✔️ ✔️
Windows x, Version 1709 ✔️ ✔️
Windows 10, Version 1607 ✔️ ✔️
Windows 8.one ✔️ ✔️
Windows vii SP1 ESU ✔️ ✔️
Windows Server 2019
Windows Server 2016
Windows Server 2012 R2
Windows Server 2012
✔️ ✔️ ✔️
Windows Server Core 2012 R2 ✔️ ✔️
Windows Server Cadre 2012 ✔️ ✔️
Nano Server, Version 1809+ ✔️ ✔️
Nano Server, Version 1803 ✔️

For more than data most .Net half-dozen supported operating systems, distributions, and lifecycle policy, see .NET 6 Supported Os Versions.

Unsupported releases

The post-obit versions of .NET are ❌ no longer supported. The downloads for these still remain published:

  • .NET Cadre 3.0
  • .NET Core 2.ii
  • .Net Cadre 2.one
  • .Internet Core 2.0

Runtime information

The runtime is used to run apps created with .Internet. When an app author publishes an app, they can include the runtime with their app. If they don't include the runtime, it's upward to the user to install the runtime.

There are iii different runtimes y'all can install on Windows:

  • ASP.NET Core runtime
    Runs ASP.NET Cadre apps. Includes the .Cyberspace runtime.

  • Desktop runtime
    Runs .Cyberspace WPF and Windows Forms desktop apps for Windows. Includes the .Cyberspace runtime.

  • .Internet runtime
    This runtime is the simplest runtime and doesn't include any other runtime. It'south highly recommended that y'all install both ASP.NET Core runtime and Desktop runtime for the all-time compatibility with .NET apps.

SDK information

The SDK is used to build and publish .Cyberspace apps and libraries. Installing the SDK includes all 3 runtimes: ASP.Net Core, Desktop, and .Net.

Arm-based Windows PCs

The following sections describe things you lot should consider when installing .NET on an Arm-based Windows PC.

What's supported

The following table describes which versions of .Net are supported on an Arm-based Windows PC:

.Internet Version Architecture SDK Runtime Path conflict
6.0 Arm64 Yes Yep No
6.0 x64 Yep Yes No
five.0 Arm64 Yes Yes Yes
v.0 x64 No Yep Yes
3.one Arm64 No No N/A
3.1 x64 No Yes Yes

The x64 and Arm64 versions of the .NET half dozen SDK be independently from each other. If a new version is released, each install needs to be upgraded.

Path differences

On an Arm-based Windows PC, all Arm64 versions of .Internet are installed to the normal C:\Program Files\dotnet\ folder. Nevertheless, when you install the x64 version of .NET vi SDK, information technology's installed to the C:\Program Files\dotnet\x64\ folder.

Path conflicts

The x64 .NET 6 SDK installs to its own directory, as described in the previous section. This allows the Arm64 and x64 versions of the .Internet 6 SDK to be on the same machine. Withal, any x64 SDK prior to vi.0 isn't supported and installs to the same location as the Arm64 version, the C:\Program Files\dotnet\ folder. If you want to install an unsupported x64 SDK, you'll need to first uninstall the Arm64 version. The opposite is likewise true, you'll demand to uninstall the unsupported x64 SDK to install the Arm64 version.

Path variables

Environment variables that add .NET to system path, such as the PATH variable, may need to be changed if you lot take both the x64 and Arm64 versions of the .Net 6 SDK installed. Additionally, some tools rely on the DOTNET_ROOT environment variable, which would also need to be updated to signal to the advisable .Net vi SDK installation folder.

Dependencies

  • .NET vi
  • .Net Core three.1

The following Windows versions are supported with .Net vi:

Note

A + symbol represents the minimum version.

Bone Version Architectures
Windows 11 21H2 x64, Arm64
Windows ten Client 1607+ x64, x86, Arm64
Windows Client 7 SP1+, 8.1 x64, x86
Windows Server 2012+ x64, x86
Windows Server Cadre 2012+ x64, x86
Nano Server 1809+ x64

For more data about .Internet vi supported operating systems, distributions, and lifecycle policy, see .NET 6 Supported OS Versions.

Windows 7 / Vista / eight.one / Server 2008 R2 / Server 2012 R2

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

Operating System Prerequisites
Windows seven SP1 ESU - Microsoft Visual C++ 2015-2019 Redistributable 64-bit / 32-chip
- KB3063858 64-scrap / 32-flake
- Microsoft Root Document Authority 2011 (.Internet Cadre 2.ane offline installer but)
Windows Vista SP ii Microsoft Visual C++ 2015-2019 Redistributable 64-bit / 32-fleck
Windows eight.1 Microsoft Visual C++ 2015-2019 Redistributable 64-scrap / 32-chip
Windows Server 2008 R2 Microsoft Visual C++ 2015-2019 Redistributable 64-chip / 32-bit
Windows Server 2012 Microsoft Visual C++ 2015-2019 Redistributable 64-scrap / 32-flake
Windows Server 2012 R2 Microsoft Visual C++ 2015-2019 Redistributable 64-flake / 32-bit

The previous requirements are also required if you receive an error related to either of the following dlls:

  • api-ms-win-crt-runtime-l1-1-0.dll
  • api-ms-win-cor-timezone-l1-one-0.dll
  • hostfxr.dll

Install with PowerShell automation

The dotnet-install scripts are used for CI automation and non-admin installs of the runtime. Yous can download the script from the dotnet-install script reference page.

The script defaults to installing the latest long term support (LTS) version, which is .NET half-dozen. You tin choose a specific release by specifying the Aqueduct switch. Include the Runtime switch to install a runtime. Otherwise, the script installs the SDK.

              dotnet-install.ps1 -Channel vi.0 -Runtime aspnetcore                          

Install the SDK past omitting the -Runtime switch. The -Channel switch is set in this example to Current, which installs the latest supported version.

              dotnet-install.ps1 -Aqueduct Current                          

Install with Visual Studio

If you lot're using Visual Studio to develop .Internet apps, the following tabular array describes the minimum required version of Visual Studio based on the target .NET SDK version.

.Cyberspace SDK version Visual Studio version
vi.0 Visual Studio 2022 version 17.0 or higher.
5.0 Visual Studio 2019 version 16.8 or higher.
three.1 Visual Studio 2019 version 16.four or higher.
3.0 Visual Studio 2019 version 16.3 or college.
2.2 Visual Studio 2017 version 15.nine or higher.
2.one Visual Studio 2017 version fifteen.7 or higher.

If you already take Visual Studio installed, yous can check your version with the following steps.

  1. Open up Visual Studio.
  2. Select Assistance > Most Microsoft Visual Studio.
  3. Read the version number from the Well-nigh dialog.

Visual Studio can install the latest .Net SDK and runtime.

Select a workload

When installing or modifying Visual Studio, select one or more of the following workloads, depending on the kind of application you're building:

  • The .Net Core cross-platform development workload in the Other Toolsets section.
  • The ASP.Net and web development workload in the Spider web & Cloud department.
  • The Azure development workload in the Spider web & Deject section.
  • The .Cyberspace desktop evolution workload in the Desktop & Mobile department.

Windows Visual Studio 2019 with .NET Core workload

Install aslope Visual Studio Lawmaking

Visual Studio Code is a powerful and lightweight source lawmaking editor that runs on your desktop. Visual Studio Code is available for Windows, macOS, and Linux.

While Visual Studio Code doesn't come with an automated .Cyberspace Core installer like Visual Studio does, adding .NET Core support is elementary.

  1. Download and install Visual Studio Code.
  2. Download and install the .NET SDK.
  3. Install the C# extension from the Visual Studio Code marketplace.

Windows Installer

The download folio for .Cyberspace provides Windows Installer executables.

When yous utilise the Windows installers to install .Internet, y'all can customize the installation path by setting the DOTNETHOME_X64 and DOTNETHOME_X86 parameters:

              dotnet-sdk-3.i.301-win-x64.exe DOTNETHOME_X64="F:\dotnet\x64" DOTNETHOME_X86="F:\dotnet\x86"                          

If y'all want to install .Cyberspace silently, such every bit in a production environment or to back up continuous integration, use the following switches:

  • /install
    Installs .Internet.

  • /quiet
    Prevents any UI and prompts from displaying.

  • /norestart
    Suppresses any attempts to restart.

              dotnet-sdk-3.1.301-win-x64.exe /install /tranquility /norestart                          

For more data, meet Standard Installer Command-Line Options.

Tip

The installer returns an exit code of 0 for success and an exit code of 3010 to indicate that a restart is required. Whatsoever other value is mostly an error code.

Download and manually install

Every bit an culling to the Windows installers for .Internet, you can download and manually install the SDK or runtime. Manual install is usually done as part of continuous integration testing. For a developer or user, it'southward generally better to utilize an installer.

Both .NET SDK and .Cyberspace Runtime can exist manually installed after they've been downloaded. If you lot install .Internet SDK, you don't need to install the respective runtime. Showtime, download a binary release for either the SDK or the runtime from one of the following sites:

  • .NET 6 downloads
  • .Cyberspace Cadre 3.i downloads
  • All .NET Cadre downloads

Create a directory to extract .Net to, for example %USERPROFILE%\dotnet. Then, extract the downloaded goose egg file into that directory.

By default, .NET CLI commands and apps won't employ .Cyberspace installed in this way and y'all must explicitly cull to utilise it. To do then, change the environment variables with which an application is started:

              set DOTNET_ROOT=%USERPROFILE%\dotnet set PATH=%USERPROFILE%\dotnet;%PATH% set DOTNET_MULTILEVEL_LOOKUP=0                          

This approach lets you install multiple versions into dissever locations, then explicitly cull which install location an application should use by running the application with surroundings variables pointing at that location.

When DOTNET_MULTILEVEL_LOOKUP is set to 0, .Net ignores any globally installed .Cyberspace version. Remove that environment setting to let .Internet consider the default global install location when selecting the best framework for running the application. The default is typically C:\Program Files\dotnet, which is where the installers install .NET.

Docker

Containers provide a lightweight way to isolate your awarding from the rest of the host arrangement. Containers on the same machine share just the kernel and use resources given to your application.

.NET can run in a Docker container. Official .NET Docker images are published to the Microsoft Container Registry (MCR) and are discoverable at the Microsoft .NET Docker Hub repository. Each repository contains images for different combinations of the .Cyberspace (SDK or Runtime) and OS that y'all can employ.

Microsoft provides images that are tailored for specific scenarios. For example, the ASP.Internet Core repository provides images that are built for running ASP.NET Core apps in product.

For more than information about using .Cyberspace in a Docker container, see Introduction to .Internet and Docker and Samples.

Troubleshooting

After installing the .Net SDK, you may run into bug trying to run .Net CLI commands. This section collects those common problems and provides solutions.

  • It was not possible to find any installed .Internet Core SDKs

Information technology was non possible to observe any installed .NET Cadre SDKs

Nearly likely y'all've installed both the x86 (32-bit) and x64 (64-bit) versions of the .NET SDK. This is causing a conflict because when you run the dotnet command it'due south resolving to the x86 version when it should resolve to the x64 version. This is usually fixed by adjusting the %PATH% variable to resolve the x64 version kickoff.

  1. Verify that you lot have both versions installed by running the where.exe dotnet command. If yous do, you should meet an entry for both the Program Files\ and Program Files (x86)\ folders. If the Program Files (x86)\ folder is first equally indicated past the post-obit example, it's incorrect and you should continue on to the next step.

                      > where.exe dotnet C:\Program Files (x86)\dotnet\dotnet.exe   C:\Program Files\dotnet\dotnet.exe                                  

    If it's correct and the Programme Files\ is first, yous don't have the problem this section is discussing and you should create a .Net aid request event on GitHub

  2. Press the Windows push and type "Edit the system environment variables" into search. Select Edit the system environment variables.

    Windows start menu with edit environment variable

  3. The System Properties window opens upward to the Advanced Tab. Select Environment Variables.

    The Windows system properties panel open.

  4. On the Environment Variables window, under the System variables grouping, select the Path* row and so select the Edit push.

    The environment variables window with user and system variables.

  5. Employ the Move Upwards and Move Down buttons to motility the C:\Plan Files\dotnet\ entry above C:\Plan Files (x86)\dotnet\.

    The environment variables list for the system.

Adjacent steps

  • How to check if .Internet is already installed.
  • Tutorial: Hello World tutorial.
  • Tutorial: Create a new app with Visual Studio Code.
  • Tutorial: Containerize a .NET Cadre app.