@@ -151,6 +151,8 @@ type Net8WindowsVersion =
151151 | " 10.0.19041.0" | " 10.0.19041" -> Some Net8WindowsVersion.V10_ 0_ 19041_ 0
152152 | _ -> None
153153
154+ type Net9WindowsVersion = Net8WindowsVersion
155+
154156[<RequireQualifiedAccess>]
155157type Net5Os =
156158 | Android
@@ -250,7 +252,8 @@ type Net8Os =
250252 ]
251253 |> Seq.tryFind( fun ( k , _ ) -> s.StartsWith k)
252254 |> Option.map snd
253-
255+
256+ type Net9Os = Net8Os
254257
255258[<RequireQualifiedAccess>]
256259/// The Framework version.
@@ -280,6 +283,7 @@ type FrameworkVersion =
280283 | V6
281284 | V7
282285 | V8
286+ | V9
283287 override this.ToString () =
284288 match this with
285289 | V1 -> " v1.0"
@@ -301,11 +305,12 @@ type FrameworkVersion =
301305 | V4_ 7_ 1 -> " v4.7.1"
302306 | V4_ 7_ 2 -> " v4.7.2"
303307 | V4_ 8 -> " v4.8"
304- | V4_ 8_ 1 -> " v4.8.1"
308+ | V4_ 8_ 1 -> " v4.8.1"
305309 | V5 -> " v5.0"
306310 | V6 -> " v6.0"
307311 | V7 -> " v7.0"
308312 | V8 -> " v8.0"
313+ | V9 -> " v9.0"
309314
310315 member this.ShortString () =
311316 match this with
@@ -333,6 +338,7 @@ type FrameworkVersion =
333338 | FrameworkVersion.V6 -> " 6.0"
334339 | FrameworkVersion.V7 -> " 7.0"
335340 | FrameworkVersion.V8 -> " 8.0"
341+ | FrameworkVersion.V9 -> " 9.0"
336342
337343 static member TryParse s =
338344 match s with
@@ -360,6 +366,7 @@ type FrameworkVersion =
360366 | " 6" -> Some FrameworkVersion.V6
361367 | " 7" -> Some FrameworkVersion.V7
362368 | " 8" -> Some FrameworkVersion.V8
369+ | " 9" -> Some FrameworkVersion.V9
363370 | _ -> None
364371
365372[<RequireQualifiedAccess>]
@@ -791,14 +798,16 @@ type TizenVersion =
791798// Each time a new version is added NuGetPackageCache.CurrentCacheVersion should be bumped.
792799type FrameworkIdentifier =
793800 | DotNetFramework of FrameworkVersion
801+ | DotNet5WithOs of Net5Os
802+ | DotNet5Windows of Net5WindowsVersion
794803 | DotNet6WithOs of Net6Os
795804 | DotNet6Windows of Net6WindowsVersion
796805 | DotNet7WithOs of Net7Os
797806 | DotNet7Windows of Net7WindowsVersion
798807 | DotNet8WithOs of Net8Os
799808 | DotNet8Windows of Net8WindowsVersion
800- | DotNet5WithOs of Net5Os
801- | DotNet5Windows of Net5WindowsVersion
809+ | DotNet9WithOs of Net9Os
810+ | DotNet9Windows of Net9WindowsVersion
802811 | UAP of UAPVersion
803812 | DotNetStandard of DotNetStandardVersion
804813 | DotNetCoreApp of DotNetCoreAppVersion
@@ -822,6 +831,8 @@ type FrameworkIdentifier =
822831 override x.ToString () =
823832 match x with
824833 | DotNetFramework v -> " net" + v.ShortString()
834+ | DotNet9WithOs o -> " net9.0-" + o.ToString()
835+ | DotNet9Windows v -> " net9.0-windows" + v.ToString()
825836 | DotNet8WithOs o -> " net8.0-" + o.ToString()
826837 | DotNet8Windows v -> " net8.0-windows" + v.ToString()
827838 | DotNet7WithOs o -> " net7.0-" + o.ToString()
@@ -934,6 +945,7 @@ type FrameworkIdentifier =
934945 | DotNetFramework FrameworkVersion.V6 -> [ DotNetFramework FrameworkVersion.V5 ]
935946 | DotNetFramework FrameworkVersion.V7 -> [ DotNetFramework FrameworkVersion.V6 ]
936947 | DotNetFramework FrameworkVersion.V8 -> [ DotNetFramework FrameworkVersion.V7 ]
948+ | DotNetFramework FrameworkVersion.V9 -> [ DotNetFramework FrameworkVersion.V8 ]
937949 | DotNet5WithOs Net5Os.Android -> [ DotNetFramework FrameworkVersion.V5; MonoAndroid MonoAndroidVersion.V12 ]
938950 | DotNet5WithOs Net5Os.IOs -> [ DotNetFramework FrameworkVersion.V5; XamariniOS ]
939951 | DotNet5WithOs Net5Os.MacOs -> [ DotNetFramework FrameworkVersion.V5; XamarinMac ]
@@ -974,6 +986,7 @@ type FrameworkIdentifier =
974986 | DotNet8Windows Net8WindowsVersion.V10_ 0_ 17763_ 0 -> [ DotNetFramework FrameworkVersion.V8; DotNet8Windows Net8WindowsVersion.V8_ 0]
975987 | DotNet8Windows Net8WindowsVersion.V10_ 0_ 18362_ 0 -> [ DotNetFramework FrameworkVersion.V8; DotNet8Windows Net8WindowsVersion.V10_ 0_ 17763_ 0 ]
976988 | DotNet8Windows Net8WindowsVersion.V10_ 0_ 19041_ 0 -> [ DotNetFramework FrameworkVersion.V8; DotNet8Windows Net8WindowsVersion.V10_ 0_ 18362_ 0 ]
989+ // remark: for now, windows version for net 9 is alias to 8
977990 | DotNetStandard DotNetStandardVersion.V1_ 0 -> [ ]
978991 | DotNetStandard DotNetStandardVersion.V1_ 1 -> [ DotNetStandard DotNetStandardVersion.V1_ 0 ]
979992 | DotNetStandard DotNetStandardVersion.V1_ 2 -> [ DotNetStandard DotNetStandardVersion.V1_ 1 ]
@@ -1089,6 +1102,7 @@ module FrameworkDetection =
10891102 | Some " 6" when dotnetVersionX = 6 -> tryParseSecondPart parts.[ 1 ]
10901103 | Some " 7" when dotnetVersionX = 7 -> tryParseSecondPart parts.[ 1 ]
10911104 | Some " 8" when dotnetVersionX = 8 -> tryParseSecondPart parts.[ 1 ]
1105+ | Some " 9" when dotnetVersionX = 9 -> tryParseSecondPart parts.[ 1 ]
10921106 | _ -> None
10931107 else
10941108 None
@@ -1103,6 +1117,7 @@ module FrameworkDetection =
11031117 | Some " 6" when dotnetVersionX = 6 -> tryParseVersion winVersionPart
11041118 | Some " 7" when dotnetVersionX = 7 -> tryParseVersion winVersionPart
11051119 | Some " 8" when dotnetVersionX = 8 -> tryParseVersion winVersionPart
1120+ | Some " 9" when dotnetVersionX = 9 -> tryParseVersion winVersionPart
11061121 | _ -> None
11071122 else
11081123 None
@@ -1142,10 +1157,12 @@ module FrameworkDetection =
11421157 // http://nugettoolsdev.azurewebsites.net/4.0.0/parse-framework?framework=.NETPortable%2CVersion%3Dv0.0%2CProfile%3DProfile2
11431158 let result =
11441159 match path with
1160+ | MatchNetXDashWindows 9 Net9WindowsVersion.TryParse fm -> Some ( DotNet9Windows fm)
11451161 | MatchNetXDashWindows 8 Net8WindowsVersion.TryParse fm -> Some ( DotNet8Windows fm)
11461162 | MatchNetXDashWindows 7 Net7WindowsVersion.TryParse fm -> Some ( DotNet7Windows fm)
11471163 | MatchNetXDashWindows 6 Net6WindowsVersion.TryParse fm -> Some ( DotNet6Windows fm)
11481164 | MatchNetXDashWindows 5 Net5WindowsVersion.TryParse fm -> Some ( DotNet5Windows fm)
1165+ | MatchNetXDashOs 9 Net9Os.TryParse fm -> Some ( DotNet9WithOs fm)
11491166 | MatchNetXDashOs 8 Net8Os.TryParse fm -> Some ( DotNet8WithOs fm)
11501167 | MatchNetXDashOs 7 Net7Os.TryParse fm -> Some ( DotNet7WithOs fm)
11511168 | MatchNetXDashOs 6 Net6Os.TryParse fm -> Some ( DotNet6WithOs fm)
@@ -1530,6 +1547,7 @@ module KnownTargetProfiles =
15301547 FrameworkVersion.V6
15311548 FrameworkVersion.V7
15321549 FrameworkVersion.V8
1550+ FrameworkVersion.V9
15331551 ]
15341552
15351553 let DotNetFrameworkIdentifiers =
@@ -1634,6 +1652,11 @@ module KnownTargetProfiles =
16341652 DotNet8WindowsVersions
16351653 |> List.map ( DotNet8Windows >> TargetProfile.SinglePlatform)
16361654
1655+ let DotNet9OperatingSystems = DotNet8OperatingSystems
1656+ let DotNet9WithOsProfiles = DotNet8WithOsProfiles
1657+ let DotNet9WindowsVersions = DotNet8WindowsVersions
1658+ let DotNet9WindowsProfiles = DotNet8WindowsProfiles
1659+
16371660 let DotNetStandardVersions = [
16381661 DotNetStandardVersion.V1_ 0
16391662 DotNetStandardVersion.V1_ 1
@@ -1805,6 +1828,8 @@ module KnownTargetProfiles =
18051828
18061829 let AllDotNetProfiles =
18071830 DotNetFrameworkProfiles @
1831+ DotNet9WithOsProfiles @
1832+ DotNet9WindowsProfiles @
18081833 DotNet8WithOsProfiles @
18091834 DotNet8WindowsProfiles @
18101835 DotNet7WithOsProfiles @
0 commit comments