How to determine if .NET Core is installed

2019-01-29 17:50发布

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.

11条回答
我欲成王,谁敢阻挡
2楼-- · 2019-01-29 18:30

It doesn't need a installation process.

I have pinned "VSCore" on my taskbar (win10), so open it, and open a task manager choose "Visual Studio Core" process expand left arrow and over any of them child process right button over it and click in "Open File Location" menu.

If you don't remember where is installed search "Code.exe" file in all your hard drives.

查看更多
仙女界的扛把子
3楼-- · 2019-01-29 18:31

On windows, You only need to open the command prompt and type:

dotnet --version

If the .net core framework installed you will get current installed version

see screenshot:

enter image description here

查看更多
Juvenile、少年°
4楼-- · 2019-01-29 18:35

I work primarily with Windows development machines and servers.

I just wanted to point out (at least for NET.Core 2.0 and above) the only thing needed is to execute dotnet --info in a command prompt to get information about the latest version installed. If .NET Core is installed you will get some response.

On my development machine (Windows 10) the result is as follows. SDK is 2.1.2 and runtime is 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 Windows Server Hosting pack (no SDK) result is as follows. No SDK, runtime is 2.0.3.

Microsoft .NET Core Shared Framework Host

Version  : 2.0.3
Build    : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

Cheers !

查看更多
神经病院院长
5楼-- · 2019-01-29 18:39

You can check if dotnet.exe is available:

where dotnet

You can then check the version:

dotnet --version

查看更多
走好不送
6楼-- · 2019-01-29 18:40

Using Powershell:

Runtimes:

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

SDK's:

(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name
查看更多
登录 后发表回答