Variable getLatestMajorNugetPackageVersionConst
getLatestMajorNugetPackageVersion: (
packageName: string,
targetFrameworkMoniker:
| "netcoreapp1.0"
| "netcoreapp1.1"
| "netcoreapp2.0"
| "netcoreapp2.1"
| "netcoreapp2.2"
| "netcoreapp3.0"
| "netcoreapp3.1"
| "net5.0"
| "net6.0"
| "net7.0"
| "net8.0"
| "net9.0"
| "net10.0"
| "netstandard1.0"
| "netstandard1.1"
| "netstandard1.2"
| "netstandard1.3"
| "netstandard1.4"
| "netstandard1.5"
| "netstandard1.6"
| "netstandard2.0"
| "netstandard2.1"
| "net11"
| "net20"
| "net35"
| "net40"
| "net403"
| "net45"
| "net451"
| "net452"
| "net46"
| "net461"
| "net462"
| "net47"
| "net471"
| "net472"
| "net48"
| "netcore"
| "netcore45"
| "netcore451"
| "netmf"
| "sl4"
| "sl5"
| "wp"
| "wp7"
| "wp75"
| "wp8"
| "wp81"
| "wpa81"
| "uap"
| "uap10.0"
| "net5.0-windows"
| "net6.0-android"
| "net6.0-ios"
| "net6.0-maccatalyst"
| "net6.0-macos"
| "net6.0-tvos"
| "net6.0-windows"
| "net7.0-android"
| "net7.0-ios"
| "net7.0-maccatalyst"
| "net7.0-macos"
| "net7.0-tvos"
| "net7.0-windows"
| "net8.0-android"
| "net8.0-browser"
| "net8.0-ios"
| "net8.0-maccatalyst"
| "net8.0-macos"
| "net8.0-tvos"
| "net8.0-windows"
| "net9.0-android"
| "net9.0-browser"
| "net9.0-ios"
| "net9.0-maccatalyst"
| "net9.0-macos"
| "net9.0-tizen"
| "net9.0-tvos"
| "net9.0-windows"
| "net10.0-android"
| "net10.0-browser"
| "net10.0-ios"
| "net10.0-maccatalyst"
| "net10.0-macos"
| "net10.0-tizen"
| "net10.0-tvos"
| "net10.0-windows",
) => Promise<number | null> = defaultNugetUtility.getLatestMajorNugetPackageVersion
Type Declaration
- (
packageName: string,
targetFrameworkMoniker:
| "netcoreapp1.0"
| "netcoreapp1.1"
| "netcoreapp2.0"
| "netcoreapp2.1"
| "netcoreapp2.2"
| "netcoreapp3.0"
| "netcoreapp3.1"
| "net5.0"
| "net6.0"
| "net7.0"
| "net8.0"
| "net9.0"
| "net10.0"
| "netstandard1.0"
| "netstandard1.1"
| "netstandard1.2"
| "netstandard1.3"
| "netstandard1.4"
| "netstandard1.5"
| "netstandard1.6"
| "netstandard2.0"
| "netstandard2.1"
| "net11"
| "net20"
| "net35"
| "net40"
| "net403"
| "net45"
| "net451"
| "net452"
| "net46"
| "net461"
| "net462"
| "net47"
| "net471"
| "net472"
| "net48"
| "netcore"
| "netcore45"
| "netcore451"
| "netmf"
| "sl4"
| "sl5"
| "wp"
| "wp7"
| "wp75"
| "wp8"
| "wp81"
| "wpa81"
| "uap"
| "uap10.0"
| "net5.0-windows"
| "net6.0-android"
| "net6.0-ios"
| "net6.0-maccatalyst"
| "net6.0-macos"
| "net6.0-tvos"
| "net6.0-windows"
| "net7.0-android"
| "net7.0-ios"
| "net7.0-maccatalyst"
| "net7.0-macos"
| "net7.0-tvos"
| "net7.0-windows"
| "net8.0-android"
| "net8.0-browser"
| "net8.0-ios"
| "net8.0-maccatalyst"
| "net8.0-macos"
| "net8.0-tvos"
| "net8.0-windows"
| "net9.0-android"
| "net9.0-browser"
| "net9.0-ios"
| "net9.0-maccatalyst"
| "net9.0-macos"
| "net9.0-tizen"
| "net9.0-tvos"
| "net9.0-windows"
| "net10.0-android"
| "net10.0-browser"
| "net10.0-ios"
| "net10.0-maccatalyst"
| "net10.0-macos"
| "net10.0-tizen"
| "net10.0-tvos"
| "net10.0-windows",
): Promise<number | null> Parameters
- packageName: string
- targetFrameworkMoniker:
| "netcoreapp1.0"
| "netcoreapp1.1"
| "netcoreapp2.0"
| "netcoreapp2.1"
| "netcoreapp2.2"
| "netcoreapp3.0"
| "netcoreapp3.1"
| "net5.0"
| "net6.0"
| "net7.0"
| "net8.0"
| "net9.0"
| "net10.0"
| "netstandard1.0"
| "netstandard1.1"
| "netstandard1.2"
| "netstandard1.3"
| "netstandard1.4"
| "netstandard1.5"
| "netstandard1.6"
| "netstandard2.0"
| "netstandard2.1"
| "net11"
| "net20"
| "net35"
| "net40"
| "net403"
| "net45"
| "net451"
| "net452"
| "net46"
| "net461"
| "net462"
| "net47"
| "net471"
| "net472"
| "net48"
| "netcore"
| "netcore45"
| "netcore451"
| "netmf"
| "sl4"
| "sl5"
| "wp"
| "wp7"
| "wp75"
| "wp8"
| "wp81"
| "wpa81"
| "uap"
| "uap10.0"
| "net5.0-windows"
| "net6.0-android"
| "net6.0-ios"
| "net6.0-maccatalyst"
| "net6.0-macos"
| "net6.0-tvos"
| "net6.0-windows"
| "net7.0-android"
| "net7.0-ios"
| "net7.0-maccatalyst"
| "net7.0-macos"
| "net7.0-tvos"
| "net7.0-windows"
| "net8.0-android"
| "net8.0-browser"
| "net8.0-ios"
| "net8.0-maccatalyst"
| "net8.0-macos"
| "net8.0-tvos"
| "net8.0-windows"
| "net9.0-android"
| "net9.0-browser"
| "net9.0-ios"
| "net9.0-maccatalyst"
| "net9.0-macos"
| "net9.0-tizen"
| "net9.0-tvos"
| "net9.0-windows"
| "net10.0-android"
| "net10.0-browser"
| "net10.0-ios"
| "net10.0-maccatalyst"
| "net10.0-macos"
| "net10.0-tizen"
| "net10.0-tvos"
| "net10.0-windows"
Returns Promise<number | null>
Same as getLatestNugetPackageVersion, except it first pulls from a hard-coded list, and only if it isn't found will it reach out to nuget.org to screen scrape and use their best guess. Only returns the major version - use it to import a package with wildcard syntax, for example:
dotnet add package SomePackage -v 7.*.Useful for packages like the EntityFramework that is technically compatible with versions of .net that they actually don't work with because of runtime dependencies of the dotnet-ef tool.