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
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. :)