How can I check from a c# application itself, what version of dotnet being used by application?
The documented way to check the version is to launch dotnet --info or dotnet --list-runtimes and inspect the results.
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).
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.
You can use the:
Environment.Version
to get the version number of the .NET runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With