How to determine if .NET Core is installed

前端 未结 16 1800
难免孤独
难免孤独 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:37

    It's possible that .NET Core is installed but not added to the PATH variable for your operating system or user profile. Running the dotnet 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

    0 讨论(0)
  • 2020-12-07 07:43

    Alternatively you can just look inside

    C:\Program Files\dotnet\sdk

    0 讨论(0)
  • 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. :)

    0 讨论(0)
  • 2020-12-07 07:45

    One of the dummies ways to determine if .NET Core is installed on Windows is:

    • Press Windows + R
    • Type cmd
    • On the command prompt, type dotnet --version

    If the .NET Core is installed, we should not get any error in the above steps.

    0 讨论(0)
提交回复
热议问题