@@ -127,7 +127,7 @@ public static bool SupportsTargetFramework(string targetFramework)
127
127
string ubuntuVersionString = restOfRid . Split ( '-' ) [ 0 ] ;
128
128
if ( float . TryParse ( ubuntuVersionString , out float ubuntuVersion ) )
129
129
{
130
- if ( ubuntuVersion > 16.04 )
130
+ if ( ubuntuVersion > 16.04f )
131
131
{
132
132
if ( nugetFramework . Version < new Version ( 2 , 0 , 0 , 0 ) )
133
133
{
@@ -144,27 +144,29 @@ public static bool SupportsTargetFramework(string targetFramework)
144
144
{
145
145
string restOfRid = currentRid . Substring ( ridOS . Length + 1 ) ;
146
146
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 ) )
150
148
{
151
149
// .NET Core 1.1 - 10.11, 10.12
152
150
// .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 )
154
156
{
155
157
if ( nugetFramework . Version >= new Version ( 2 , 0 , 0 , 0 ) )
156
158
{
157
159
return false ;
158
160
}
159
161
}
160
- else if ( osxVersion == 12 )
162
+ else if ( osxVersion == 10.12f )
161
163
{
162
164
if ( nugetFramework . Version < new Version ( 2 , 0 , 0 , 0 ) )
163
165
{
164
166
return false ;
165
167
}
166
168
}
167
- else if ( osxVersion > 12 )
169
+ else if ( osxVersion > 10.12f && osxVersion <= 10.15f )
168
170
{
169
171
// .NET Core 2.0 is out of support, and doesn't seem to work with OS X 10.14
170
172
// (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)
173
175
return false ;
174
176
}
175
177
}
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
+ }
176
199
}
177
200
}
178
201
0 commit comments