@@ -127,7 +127,7 @@ public static bool SupportsTargetFramework(string targetFramework)
127127 string ubuntuVersionString = restOfRid . Split ( '-' ) [ 0 ] ;
128128 if ( float . TryParse ( ubuntuVersionString , out float ubuntuVersion ) )
129129 {
130- if ( ubuntuVersion > 16.04 )
130+ if ( ubuntuVersion > 16.04f )
131131 {
132132 if ( nugetFramework . Version < new Version ( 2 , 0 , 0 , 0 ) )
133133 {
@@ -144,27 +144,29 @@ public static bool SupportsTargetFramework(string targetFramework)
144144 {
145145 string restOfRid = currentRid . Substring ( ridOS . Length + 1 ) ;
146146 string osxVersionString = restOfRid . Split ( '-' ) [ 0 ] ;
147- // From a string such as "10.14", get the second part, e.g. "14"
148- string osxVersionString2 = osxVersionString . Split ( '.' ) [ 1 ] ;
149- if ( int . TryParse ( osxVersionString2 , out int osxVersion ) )
147+ if ( float . TryParse ( osxVersionString , out float osxVersion ) )
150148 {
151149 // .NET Core 1.1 - 10.11, 10.12
152150 // .NET Core 2.0 - 10.12+
153- if ( osxVersion <= 11 )
151+ // .NET Core 2.1 - 10.12-10.15
152+ // .NET 5 <= 11.0
153+ // .NET 6 <= 12
154+ // .NET 7 <= 13
155+ if ( osxVersion <= 10.11f )
154156 {
155157 if ( nugetFramework . Version >= new Version ( 2 , 0 , 0 , 0 ) )
156158 {
157159 return false ;
158160 }
159161 }
160- else if ( osxVersion == 12 )
162+ else if ( osxVersion == 10.12f )
161163 {
162164 if ( nugetFramework . Version < new Version ( 2 , 0 , 0 , 0 ) )
163165 {
164166 return false ;
165167 }
166168 }
167- else if ( osxVersion > 12 )
169+ else if ( osxVersion > 10.12f && osxVersion <= 10.15f )
168170 {
169171 // .NET Core 2.0 is out of support, and doesn't seem to work with OS X 10.14
170172 // (it finds no assets for the RID), even though the support page says "10.12+"
@@ -173,6 +175,27 @@ public static bool SupportsTargetFramework(string targetFramework)
173175 return false ;
174176 }
175177 }
178+ else if ( osxVersion == 11.0f )
179+ {
180+ if ( nugetFramework . Version < new Version ( 5 , 0 , 0 , 0 ) )
181+ {
182+ return false ;
183+ }
184+ }
185+ else if ( osxVersion == 12.0f )
186+ {
187+ if ( nugetFramework . Version < new Version ( 6 , 0 , 0 , 0 ) )
188+ {
189+ return false ;
190+ }
191+ }
192+ else if ( osxVersion > 12.0f )
193+ {
194+ if ( nugetFramework . Version < new Version ( 7 , 0 , 0 , 0 ) )
195+ {
196+ return false ;
197+ }
198+ }
176199 }
177200 }
178201
0 commit comments