Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if .NET Core is installed

I know that for older versions of .NET, you can determine if a given version is installed by following

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

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

(And I don't mean the SDK, I want to check a server without the SDK, to determine if it has DotNetCore.1.0.0-WindowsHosting.exe 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# of 1.0.11123.0 on my windows 7 machine, but I don't see the same stuff on my Windows 10 machine.

like image 649
weloytty Avatar asked Jul 25 '16 12:07

weloytty


People also ask

How do you check if I have Dotnet installed?

Open Start. Search for PowerShell, right-click the top result, and select the Run as administrator option. Type the following command to check the version of . NET installed and press Enter: Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.

Is .NET Core installed with Visual Studio?

NET Core can be installed in two ways: By installing Visual Studio 2017/2019 or by installing . NET Core Runtime or SDK. . NET Core installer already contains ASP.NET Core libraries, so there is no separate installer for ASP.NET Core.

Where can I find NET Core?

You can view, download, or contribute to the source code using the following GitHub repositories: Language compiler platform Roslyn: https://github.com/dotnet/roslyn. . NET Core runtime: https://github.com/dotnet/runtime.


1 Answers

Great question, and the answer is not a simple one. There is no "show me all .net core versions" command, but there's hope.

EDIT:

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

dotnet --info

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

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

I'm on Windows, but I'd guess that would work on Mac or Linux as well with a current version.

Also, you can reference the .NET Core Download Archive to help you decipher the SDK versions.


OLDER INFORMATION: Everything below this point is old information, which is less relevant, but may still be useful.

See installed Runtimes:

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

See installed SDKs:

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

(Source for the locations: A developer's blog)


In addition, you can see the latest Runtime and SDK versions installed by issuing these commands at the command prompt:

dotnet Latest Runtime version is the first thing listed. DISCLAIMER: This no longer works, but may work for older versions.

dotnet --version Latest SDK version DISCLAIMER: Apparently the result of this may be affected by any global.json config files.


On macOS you could check .net core version by using below command.

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

On Ubuntu or Alpine:

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

It will list down the folder with installed version name.

like image 169
Sean Avatar answered Sep 23 '22 06:09

Sean