How to determine if .NET Core is installed

前端 未结 16 1814
难免孤独
难免孤独 2020-12-07 06:53

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  
         


        
16条回答
  •  再見小時候
    2020-12-07 07:44

    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:

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

提交回复
热议问题