How to determine if .NET Core is installed

I know that for older versions of .NET you can determine if this version is installed by running

https://support.microsoft.com/en-us/kb/318785 

Is there an official method for determining if .NET Core is installed?

(And I do not mean the SDK, I want to check the server without the SDK to determine if DotNetCore.1.0.0-WindowsHosting.exe is installed on it)

I can see

 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NET Cross-Platform Runtime Environment\.NET Framework 4.6\Win\v1-rc1 

with version # 1.0.11123.0 on my Windows 7 computer, but I donโ€™t see the same thing on my Windows 10 computer.

+199
c # asp.net-core .net-core
Jul 25 '16 at 12:07
source share
12 answers

Using Powershell :

Runtimes:

 (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\Microsoft.NETCore.App')).Name 

SDK:

 (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name 
+118
Jan 31 '18 at 13:14
source share

Great question, and the answer is not easy. There is no "show all versions of .net core" command, but there is hope.

EDIT:

I'm not sure when it was added, but the info command now includes this information in its output. It will print the installed runtimes and SDKs, as well as some other information:

dotnet --info

If you want to see only the SDK: dotnet --list-sdks

If you want to see only installed dotnet --list-runtimes : dotnet --list-runtimes

I'm on Windows, but I think this will work on Mac or Linux with the current version.

Alternatively, you can refer to the .NET Core Download Archive to help you decrypt versions of the SDK.




SENIOR INFORMATION: Everything below this item is old information that is less relevant but can still be useful.

See Installed Runtimes:

Open C:\Program Files\dotnet\shared\Microsoft.NETCore.App in Windows Explorer.

See the installed SDKs :

Open C:\Program Files\dotnet\sdk in Windows Explorer.

(Source for locations: developer blog )




In addition, you can see the latest installed versions of Runtime and SDK by entering these commands at the command line:

dotnet The latest version of Runtime is the first on the list. DISCLAIMER: This no longer works, but may work for older versions.

dotnet --version Latest SDK DISCLAIMER: Apparently, any global.json configuration files may affect the result.




On macOS, you can check the .net kernel version using the command below.

 ls /usr/local/share/dotnet/shared/Microsoft.NETCore.App/ 

On Ubuntu or Alpine:

 ls /usr/share/dotnet/shared/Microsoft.NETCore.App/ 

A list of folders with the name of the installed version will be displayed.

+235
Feb 18 '17 at
source share

The correct answer for non-SDK runtime environments, such as a server with Windows Hosting installed, is to start PowerShell with the following command:

 dotnet --info 

In the official documentation :

  • The --version parameter "Prints the version of the .NET Core SDK used." and therefore does not work if the SDK is not installed. While...
  • Option --info "Prints detailed information about CLI tools and the environment, such as the current operating system, passes SHA for version and other information."

Here's another official article explaining how it works . :)

+121
Oct. 20 '17 at 10:44 on
source share

You can check if dotnet.exe is available:

where dotnet

Then you can check the version:

dotnet --version

+71
Jul 25 '16 at 14:08
source share

One of the search methods installed in Windows .NET Core is:

  • Press Windows + R
  • Type cmd
  • At the command prompt, enter dotnet --version

dotnet -version

If .NET Core installed, we should not be mistaken in the above steps.

+44
Oct. 18 '16 at 5:47
source share

(1) If you are in a window system.

Open a command prompt.

  dotnet --version 

(2) Run the command below if you are running on a Linux system.

 dotnet --version dotnet --info 
+16
Dec 02 '17 at 5:37
source share

I work mainly with machines and servers for Windows development.

I just wanted to specify (at least for NET.Core 2.0 and later), the only thing needed is to run dotnet --info on the command line to get information about the latest version installed. If .NET Core is installed, you will get a response.

On my development machine (Windows 10), the result is as follows. SDK 2.1.2 and Runtime 2.0.3.

 .NET Command Line Tools (2.1.2) Product Information: Version: 2.1.2 Commit SHA-1 hash: 5695315371 Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df 

On one of my servers running Windows Server 2016 with a Windows Server hosting package (without SDK), the result is as follows. No SDK, runtime 2.0.3.

 Microsoft .NET Core Shared Framework Host Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df 

Hurrah!

+12
Jan 05 '18 at 19:30
source share

The following commands are available in the .NET Core SDK 2.1 (v2.1.300) :

To get a list of all installed .NET Core SDKs, use: dotnet --list-sdks

To see a list of all installed .NET Core dotnet --list-runtimes use dotnet --list-runtimes

(tested on Windows at the time of writing, June 3, 2018 and again on August 23, 2018)

Update from dotnet --info 2018: dotnet --info option is probably now dotnet --info in a terminal or PowerShell window, as mentioned in other answers.

+8
Jun 02
source share

On Windows, you just need to open a command prompt and type:

 dotnet --version 

If the main .net platform is installed, you will get the current version installed

see screenshot:

enter image description here

+5
May 30 '18 at 19:35
source share

Look in C:\Program Files\dotnet\shared\Microsoft.NETCore.App to see which versions of the runtime have directories there. Source.

Many of the answers here confuse the SDKs with Runtime, which are different.

0
Oct 23 '18 at 16:40
source share

After all the other answers, this may be useful.

Open your application in Visual Studio. In Solution Explorer, right-click your project. Click Properties. Click Application. Under the "Target Framework", click the drop-down button, and here you are all the installed frameworks.

By the way - you can now choose which wireframe you want.

0
May 15, '19 at 14:17
source share

This does not require an installation process.

I fixed "VSCore" on my taskbar (win10), so open it and open the task manager, select "Visual Studio Core", expand the left arrow and any of them a child process, click the right button above it and click "Open file location " "menu.

If you do not remember where it is installed, find the "Code.exe" file on all your hard drives.

-5
Apr 24 '18 at 14:06
source share



All Articles