Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify my dotnet version [duplicate]

Tags:

c#

.net

How can I check from a c# application itself, what version of dotnet being used by application?

like image 825
hungryMind Avatar asked Feb 23 '11 10:02

hungryMind


People also ask

How do I know if I have .NET 5?

The documented way to check the version is to launch dotnet --info or dotnet --list-runtimes and inspect the results.

How do I know if Dotnet is installed?

You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).


2 Answers

Use Environment.Version - it gives you the exact version of .NET running the application.

Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.


To find out what version of the framework is installed, see this SO question and answers. In a nut shell, you will need to dig into the registry.

like image 196
Oded Avatar answered Sep 21 '22 12:09

Oded


You can use the:

Environment.Version

to get the version number of the .NET runtime.

like image 22
Anders Zommarin Avatar answered Sep 22 '22 12:09

Anders Zommarin