DotNetVersionFinder 2.1.1
dotnet add package DotNetVersionFinder --version 2.1.1
NuGet\Install-Package DotNetVersionFinder -Version 2.1.1
<PackageReference Include="DotNetVersionFinder" Version="2.1.1" />
paket add DotNetVersionFinder --version 2.1.1
#r "nuget: DotNetVersionFinder, 2.1.1"
// Install DotNetVersionFinder as a Cake Addin #addin nuget:?package=DotNetVersionFinder&version=2.1.1 // Install DotNetVersionFinder as a Cake Tool #tool nuget:?package=DotNetVersionFinder&version=2.1.1
DotNetVersionFinder
Provides functionality to find the highest version of .NET that is installed on a system. Supports both .NET Framework (4.5 onwards) and newer .NET versions (.NET Core 1-3, and then .NET 5 onwards).
Quickstart
- Install the package from NuGet
- Call
DotNetVersion.GetVersion()
- You're done!
Alternatively, if you want to be more specific as to which .NET version you're getting, you can use: DotNetVersion.GetDotNetCliVersion()
or DotNetVersion.GetFrameworkVersion()
. Also, for power users, you can get the release key from the registry using DotNetVersion.GetFrameworkReleaseKey()
.
Supported .NET verions
- .NET via the dotnet CLI. Supports all versions of .NET from 5 onwards.
- .NET Core via the dotnet CLI. Supports all versions of .NET core.
- .NET Framework via the registry. Supports .NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1.
This library doesn't currently support .NET Framework versions 1.0 through to 4.0, as they are no longer supported by Microsoft, and they add additional complexity to the code. However, if there is enough demand I will gladly add support. Pull requests are welcome.
Release notes
2.1.0
- Use
--list-runtimes
rather than--version
when determining version via the dotnet CLI. This gives the runtime version rather than the SDK version, which is more correct for our usage.
2.0.0
- Overhaul API.
- Add support for .NET 5+
- Add support for .NET Core 1-3
- Add support for .NET Framework 4.8.1
1.1.3
- Add support for .NET Framework 4.8.
1.1.2
- Add support for undocumented release keys.
1.1.0
- Add support for retrieving the current .NET Framework release key via
DotNetVersion.FindReleaseKey()
.
1.0.1
- Add support for .NET Framework 4.7.2.
1.0.0
- Initial release.
Installation
Just grab it from NuGet
PM> Install-Package DotNetVersionFinder
License and copyright
Copyright (c) Matthew King. Distributed under the MIT License. Refer to license.txt for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.5
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.