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
It's possible that .NET Core is installed but not added to the
PATH
variable for your operating system or user profile. Running thedotnet
commands may not work. As an alternative, you can check that the .NET Core install folders exist.
It's installed to a standard folder if you didn't change it during the instillation
dotnet executable C:\program files\dotnet\dotnet.exe
.NET SDK C:\program files\dotnet\sdk\{version}\
.NET Runtime C:\program files\dotnet\shared\{runtime-type}\{version}\
For more details check How to check that .NET Core is already installed page at .NET documentation
Alternatively you can just look inside
C:\Program Files\dotnet\sdk
The correct answer for runtime-only environments without the SDK, such as a server with the Windows Hosting package installed, is to run PowerShell with the following command:
dotnet --info
Per the official documentation:
--version
option "Prints out the version of the .NET Core SDK in use." and therefore doesn't work if the SDK is not installed. Whereas...--info
option "Prints out detailed information about the CLI tooling and the environment, such as the current operating system, commit SHA for the version, and other information."Here's another official article explaining how .NET Core versioning works. :)
One of the dummies ways to determine if .NET Core
is installed on Windows is:
cmd
dotnet --version
If the .NET Core
is installed, we should not get any error in the above steps.