How to determine if .NET Core is installed

How to determine if NET Core is installed

Today in this article, we will see How to Check .NET Core version installed SDK and Runtime details. We will see easy commands that let you verify the below details,

Today in this article, we will cover below aspects,

You might want to check the .NET Core version installed on the target machine/server.

Today we will see how to check the .NET Core version using the Manually using CLI tools and will also see how to get the runtime version installed using C# Programmatically.

Determine if .NET Core is installed

Below is the simple command to get details of all .NET Core family versions,

dotnet --info

how to determine if net core is installed

Alternatively one can also use the below commands to get the details,

Determine the .NET Core SDK version

Below are a few additional commands to help to determine the .NET Core SDK and runtime version installed on the target machine/Server.

These commands can be executed on Windows/Mac/Linux machines.

Please use the below commands to find the SDK version installed.

dotnet --list-sdks

Check NET Core version

Determine .NET Core Runtime version

Please use the below commands to find the .NET Core runtime version installed.

dotnet --list-runtimes
Check Installed NET Core version

Check .NET Core version- SDK and Runtime version Programmatically

You can check the .NET Core version SDK or Runtime version of .NET Core programmatically using the below code,

  var netCoreVersion = Environment.Version; 
  var runtimeVersion= RuntimeInformation.FrameworkDescription;

Example:

check net version cmd Determine NET Core Runtime version

Please use the below-using namespaces in your code,

using System.Runtime.InteropServices;
using System;

References :

Do you have any comments or ideas or any better suggestions to share?

Please sound off your comments below.

Happy Coding !!



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



Leave a Reply

Your email address will not be published. Required fields are marked *