Skip to content

Commit 7ce7132

Browse files
authored
Merge pull request #10995 from KevinRansom/renamenetcoreapp50
Cherry pick Rename netcoreapp5.0
2 parents a2533e8 + 603176a commit 7ce7132

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/fsharp/FxResolver.fs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ type internal FxResolver(assumeDotNetFramework: bool option, projectDir: string,
295295
let startPos =
296296
let startPos = file.IndexOf(pattern, StringComparison.OrdinalIgnoreCase)
297297
if startPos >= 0 then startPos + (pattern.Length) else startPos
298-
299298
let length =
300299
if startPos >= 0 then
301300
let ep = file.IndexOf("\"", startPos)
@@ -305,16 +304,21 @@ type internal FxResolver(assumeDotNetFramework: bool option, projectDir: string,
305304
| -1, _
306305
| _, -1 ->
307306
if isRunningOnCoreClr then
308-
// Running on coreclr but no deps.json was deployed with the host so default to 3.1
309-
Some "netcoreapp3.1"
307+
// Running on coreclr but no deps.json was deployed with the host so default to 5.0
308+
Some "net5.0"
310309
else
311310
// Running on desktop
312311
None
313312
| pos, length ->
314313
// use value from the deps.json file
315-
Some ("netcoreapp" + file.Substring(pos, length))
316-
317-
// Tries to figure out the tfm for the compiler instance on the Windows desktop.
314+
let suffix = file.Substring(pos, length)
315+
let prefix =
316+
match Double.TryParse(suffix) with
317+
| true, value when value < 5.0 -> "netcoreapp"
318+
| _ -> "net"
319+
Some (prefix + suffix)
320+
321+
// Tries to figure out the tfm for the compiler instance on the Windows desktop
318322
// On full clr it uses the mscorlib version number
319323
let getRunningDotNetFrameworkTfm () =
320324
let defaultMscorlibVersion = 4,8,3815,0

0 commit comments

Comments
 (0)