Variable getLatestNugetPackageVersionConst
getLatestNugetPackageVersion: (
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<string | null> = defaultNugetUtility.getLatestNugetPackageVersion
Get the newest version number for the nuget package that is compatible with the specified .net version. This logic scrapes nuget.org to take a guess. Note that that's all it is - a guess. Nuget doesn't actually know anything about compatibility and is also taking giant guesses based on package transitive dependencies and general compatibilities between framework versions. Nuget does not actually guarantee any type of real compatibility in any sense of the word - it just pulls the latest version when you add a package unless you specify one, and you won't know if it's compatible until a restore or build command happens. This method is an attempt to at least use the nuget.org guess instead of just using the latest version.