diff --git a/eng/Signing.props b/eng/Signing.props
index 5ceb96ac54bf9..463c3602bb7f9 100644
--- a/eng/Signing.props
+++ b/eng/Signing.props
@@ -71,7 +71,6 @@
-
diff --git a/eng/Subsets.props b/eng/Subsets.props
index 3aec271bc0c15..f7c472357e68c 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -13,7 +13,7 @@
./build.sh corehost installer.managed
- This builds the CoreHost and also the Managed installer portion (e.g. Microsoft.DotNet.PlatformAbstractions)
+ This builds the CoreHost and also the Managed installer portion (e.g. Microsoft.NET.HostModel)
projects. A space ' ' or '+' are the delimiters between multiple subsets to build.
./build.sh -test installer.tests
@@ -104,7 +104,7 @@
-
+
diff --git a/eng/Versions.props b/eng/Versions.props
index 2ef1900170fd3..f3a6253599fe3 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -67,8 +67,7 @@
5.0.0-preview.4.20202.18
5.0.0-preview.4.20202.18
5.0.0-preview.4.20202.18
- 2.1.0
- 3.0.0
+ 3.1.0
5.0.0-preview.4.20202.18
5.0.0-preview.4.20202.18
diff --git a/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj b/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj
index a3fde0fd8eab2..73e115381ce75 100644
--- a/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj
+++ b/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj
@@ -43,7 +43,6 @@
-
diff --git a/src/installer/Microsoft.DotNet.CoreSetup.sln b/src/installer/Microsoft.DotNet.CoreSetup.sln
index e3b39fe6aff62..9e432a1616caa 100644
--- a/src/installer/Microsoft.DotNet.CoreSetup.sln
+++ b/src/installer/Microsoft.DotNet.CoreSetup.sln
@@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.PlatformAbstractions", "managed\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj", "{04D84DC8-A509-43FE-B846-16B770D9E3AA}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostActivation.Tests", "test\HostActivation.Tests\HostActivation.Tests.csproj", "{23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils", "test\TestUtils\TestUtils.csproj", "{D6676666-D14D-4DFA-88FB-76E3E823E2E1}"
@@ -41,22 +39,6 @@ Global
RelWithDebInfo|x64 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Debug|x64.Build.0 = Debug|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.MinSizeRel|x64.ActiveCfg = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.MinSizeRel|x64.Build.0 = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Release|Any CPU.Build.0 = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Release|x64.ActiveCfg = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.Release|x64.Build.0 = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
- {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.Debug|x64.ActiveCfg = Debug|Any CPU
diff --git a/src/installer/corehost/cli/hostmisc/pal.h b/src/installer/corehost/cli/hostmisc/pal.h
index 743687546ad07..1e1f4cf5f5c4f 100644
--- a/src/installer/corehost/cli/hostmisc/pal.h
+++ b/src/installer/corehost/cli/hostmisc/pal.h
@@ -249,7 +249,6 @@ namespace pal
inline void err_flush() { std::fflush(stderr); }
inline void out_flush() { std::fflush(stdout); }
- // Based upon https://github.com/dotnet/core-setup/blob/master/src/Microsoft.DotNet.PlatformAbstractions/Native/PlatformApis.cs
string_t get_current_os_rid_platform();
inline string_t get_current_os_fallback_rid()
{
diff --git a/src/installer/managed/CommonManaged.props b/src/installer/managed/CommonManaged.props
index 5195cc2c4dd56..90768f0657a2a 100644
--- a/src/installer/managed/CommonManaged.props
+++ b/src/installer/managed/CommonManaged.props
@@ -16,15 +16,6 @@
true
$(NoWarn);CS1591
-
-
@@ -34,20 +25,11 @@
true
-
- true
-
-
git
- git://github.com/dotnet/core-setup
+ git://github.com/dotnet/runtime
-
-
-
-
-
(TValue value, IEqualityComparer comparer)
- {
- var hashCode = value != null ? comparer.GetHashCode(value) : 0;
- Add(hashCode);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static HashCodeCombiner Start()
- {
- return new HashCodeCombiner(0x1505L);
- }
- }
-}
\ No newline at end of file
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj
deleted file mode 100644
index 93d5362c72e23..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- Abstractions for making code that uses file system and environment testable.
- net45;netstandard1.3;netstandard2.0
- netstandard1.3;netstandard2.0
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Darwin.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Darwin.cs
deleted file mode 100644
index 0e0b7c0c576d6..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Darwin.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.DotNet.PlatformAbstractions.Native
-{
- internal static partial class NativeMethods
- {
- public static class Darwin
- {
- private const int CTL_KERN = 1;
- private const int KERN_OSRELEASE = 2;
-
- public unsafe static string GetKernelRelease()
- {
- const uint BUFFER_LENGTH = 32;
-
- var name = stackalloc int[2];
- name[0] = CTL_KERN;
- name[1] = KERN_OSRELEASE;
-
- var buf = stackalloc byte[(int)BUFFER_LENGTH];
- var len = stackalloc uint[1];
- *len = BUFFER_LENGTH;
-
- try
- {
- // If the buffer isn't big enough, it seems sysctl still returns 0 and just sets len to the
- // necessary buffer size. This appears to be contrary to the man page, but it's easy to detect
- // by simply checking len against the buffer length.
- if (sysctl(name, 2, buf, len, IntPtr.Zero, 0) == 0 && *len < BUFFER_LENGTH)
- {
- return Marshal.PtrToStringAnsi((IntPtr)buf, (int)*len);
- }
- }
- catch (Exception ex)
- {
- throw new PlatformNotSupportedException("Error reading Darwin Kernel Version", ex);
- }
- throw new PlatformNotSupportedException("Unknown error reading Darwin Kernel Version");
- }
-
- [DllImport("libc")]
- private unsafe static extern int sysctl(
- int* name,
- uint namelen,
- byte* oldp,
- uint* oldlenp,
- IntPtr newp,
- uint newlen);
- }
- }
-}
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Unix.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Unix.cs
deleted file mode 100644
index c1976308260f1..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Unix.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-#if NET45
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.DotNet.PlatformAbstractions.Native
-{
- internal static partial class NativeMethods
- {
- public static class Unix
- {
- public unsafe static string GetUname()
- {
- // Utsname shouldn't be larger than 2K
- var buf = stackalloc byte[2048];
-
- try
- {
- if (uname((IntPtr)buf) == 0)
- {
- return Marshal.PtrToStringAnsi((IntPtr)buf);
- }
- }
- catch (Exception ex)
- {
- throw new PlatformNotSupportedException("Error reading Unix name", ex);
- }
- throw new PlatformNotSupportedException("Unknown error reading Unix name");
- }
-
- [DllImport("libc")]
- private static extern int uname(IntPtr utsname);
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Windows.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Windows.cs
deleted file mode 100644
index 58c31603a0e1f..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/NativeMethods.Windows.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace Microsoft.DotNet.PlatformAbstractions.Native
-{
- internal static partial class NativeMethods
- {
- public static class Windows
- {
- [StructLayout(LayoutKind.Sequential)]
- internal struct RTL_OSVERSIONINFOEX
- {
- internal uint dwOSVersionInfoSize;
- internal uint dwMajorVersion;
- internal uint dwMinorVersion;
- internal uint dwBuildNumber;
- internal uint dwPlatformId;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
- internal string szCSDVersion;
- }
-
- // This call avoids the shimming Windows does to report old versions
- [DllImport("ntdll")]
- private static extern int RtlGetVersion(out RTL_OSVERSIONINFOEX lpVersionInformation);
-
- internal static string RtlGetVersion()
- {
- RTL_OSVERSIONINFOEX osvi = new RTL_OSVERSIONINFOEX();
- osvi.dwOSVersionInfoSize = (uint)Marshal.SizeOf(osvi);
- if (RtlGetVersion(out osvi) == 0)
- {
- return $"{osvi.dwMajorVersion}.{osvi.dwMinorVersion}.{osvi.dwBuildNumber}";
- }
- else
- {
- return null;
- }
- }
- }
- }
-}
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/PlatformApis.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/PlatformApis.cs
deleted file mode 100644
index 1a344034304e7..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/PlatformApis.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.DotNet.PlatformAbstractions.Native
-{
- internal static class PlatformApis
- {
- private class DistroInfo
- {
- public string Id;
- public string VersionId;
- }
-
- private static readonly Lazy _platform = new Lazy(DetermineOSPlatform);
- private static readonly Lazy _distroInfo = new Lazy(LoadDistroInfo);
-
- public static string GetOSName()
- {
- switch (GetOSPlatform())
- {
- case Platform.Windows:
- return "Windows";
- case Platform.Linux:
- return GetDistroId() ?? "Linux";
- case Platform.Darwin:
- return "Mac OS X";
- case Platform.FreeBSD:
- return "FreeBSD";
- default:
- return "Unknown";
- }
- }
-
- public static string GetOSVersion()
- {
- switch (GetOSPlatform())
- {
- case Platform.Windows:
- return NativeMethods.Windows.RtlGetVersion() ?? string.Empty;
- case Platform.Linux:
- return GetDistroVersionId() ?? string.Empty;
- case Platform.Darwin:
- return GetDarwinVersion() ?? string.Empty;
- case Platform.FreeBSD:
- return GetFreeBSDVersion() ?? string.Empty;
- default:
- return string.Empty;
- }
- }
-
- private static string GetDarwinVersion()
- {
- Version version;
- var kernelRelease = NativeMethods.Darwin.GetKernelRelease();
- if (!Version.TryParse(kernelRelease, out version) || version.Major < 5)
- {
- // 10.0 covers all versions prior to Darwin 5
- // Similarly, if the version is not a valid version number, but we have still detected that it is Darwin, we just assume
- // it is OS X 10.0
- return "10.0";
- }
- else
- {
- // Mac OS X 10.1 mapped to Darwin 5.x, and the mapping continues that way
- // So just subtract 4 from the Darwin version.
- // https://en.wikipedia.org/wiki/Darwin_%28operating_system%29
- return $"10.{version.Major - 4}";
- }
- }
-
- private static string GetFreeBSDVersion()
- {
- // This is same as sysctl kern.version
- // FreeBSD 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC
- // What we want is major release as minor releases should be compatible.
- String version = RuntimeInformation.OSDescription;
- try
- {
- // second token up to first dot
- return RuntimeInformation.OSDescription.Split()[1].Split('.')[0];
- }
- catch
- {
- }
- return string.Empty;
- }
-
- public static Platform GetOSPlatform()
- {
- return _platform.Value;
- }
-
- private static string GetDistroId()
- {
- return _distroInfo.Value?.Id;
- }
-
- private static string GetDistroVersionId()
- {
- return _distroInfo.Value?.VersionId;
- }
-
- private static DistroInfo LoadDistroInfo()
- {
- DistroInfo result = null;
-
- // Sample os-release file:
- // NAME="Ubuntu"
- // VERSION = "14.04.3 LTS, Trusty Tahr"
- // ID = ubuntu
- // ID_LIKE = debian
- // PRETTY_NAME = "Ubuntu 14.04.3 LTS"
- // VERSION_ID = "14.04"
- // HOME_URL = "http://www.ubuntu.com/"
- // SUPPORT_URL = "http://help.ubuntu.com/"
- // BUG_REPORT_URL = "http://bugs.launchpad.net/ubuntu/"
- // We use ID and VERSION_ID
-
- if (File.Exists("/etc/os-release"))
- {
- var lines = File.ReadAllLines("/etc/os-release");
- result = new DistroInfo();
- foreach (var line in lines)
- {
- if (line.StartsWith("ID=", StringComparison.Ordinal))
- {
- result.Id = line.Substring(3).Trim('"', '\'');
- }
- else if (line.StartsWith("VERSION_ID=", StringComparison.Ordinal))
- {
- result.VersionId = line.Substring(11).Trim('"', '\'');
- }
- }
- }
-
- if (result != null)
- {
- result = NormalizeDistroInfo(result);
- }
-
- return result;
- }
-
- // For some distros, we don't want to use the full version from VERSION_ID. One example is
- // Red Hat Enterprise Linux, which includes a minor version in their VERSION_ID but minor
- // versions are backwards compatable.
- //
- // In this case, we'll normalized RIDs like 'rhel.7.2' and 'rhel.7.3' to a generic
- // 'rhel.7'. This brings RHEL in line with other distros like CentOS or Debian which
- // don't put minor version numbers in their VERSION_ID fields because all minor versions
- // are backwards compatible.
- private static DistroInfo NormalizeDistroInfo(DistroInfo distroInfo)
- {
- // Handle if VersionId is null by just setting the index to -1.
- int lastVersionNumberSeparatorIndex = distroInfo.VersionId?.IndexOf('.') ?? -1;
-
- if (lastVersionNumberSeparatorIndex != -1 && distroInfo.Id == "alpine")
- {
- // For Alpine, the version reported has three components, so we need to find the second version separator
- lastVersionNumberSeparatorIndex = distroInfo.VersionId.IndexOf('.', lastVersionNumberSeparatorIndex + 1);
- }
-
- if (lastVersionNumberSeparatorIndex != -1 && (distroInfo.Id == "rhel" || distroInfo.Id == "alpine"))
- {
- distroInfo.VersionId = distroInfo.VersionId.Substring(0, lastVersionNumberSeparatorIndex);
- }
-
- return distroInfo;
- }
-
- // I could probably have just done one method signature and put the #if inside the body but the implementations
- // are just completely different so I wanted to make that clear by putting the whole thing inside the #if.
-#if NET45
- private static Platform DetermineOSPlatform()
- {
- var platform = (int)Environment.OSVersion.Platform;
- var isWindows = (platform != 4) && (platform != 6) && (platform != 128);
-
- if (isWindows)
- {
- return Platform.Windows;
- }
- else
- {
- try
- {
- var uname = NativeMethods.Unix.GetUname();
- if (string.Equals(uname, "Darwin", StringComparison.OrdinalIgnoreCase))
- {
- return Platform.Darwin;
- }
- if (string.Equals(uname, "Linux", StringComparison.OrdinalIgnoreCase))
- {
- return Platform.Linux;
- }
- if (string.Equals(uname, "FreeBSD", StringComparison.OrdinalIgnoreCase))
- {
- return Platform.FreeBSD;
- }
- }
- catch
- {
- }
- return Platform.Unknown;
- }
- }
-#else
- private static Platform DetermineOSPlatform()
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- return Platform.Windows;
- }
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- {
- return Platform.Linux;
- }
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- return Platform.Darwin;
- }
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")))
- {
- return Platform.FreeBSD;
- }
-
- return Platform.Unknown;
- }
-#endif
- }
-}
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Platform.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Platform.cs
deleted file mode 100644
index a8d7477ec55c2..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Platform.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright(c) .NET Foundation and contributors.All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-namespace Microsoft.DotNet.PlatformAbstractions
-{
- public enum Platform
- {
- Unknown = 0,
- Windows = 1,
- Linux = 2,
- Darwin = 3,
- FreeBSD = 4
- }
-}
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Properties/Properties.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Properties/Properties.cs
deleted file mode 100644
index ffc81f49b41fe..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Properties/Properties.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs
deleted file mode 100644
index ffece180eb960..0000000000000
--- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright(c) .NET Foundation and contributors.All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Runtime.InteropServices;
-using Microsoft.DotNet.PlatformAbstractions.Native;
-
-namespace Microsoft.DotNet.PlatformAbstractions
-{
- public static class RuntimeEnvironment
- {
- private static readonly string OverrideEnvironmentVariableName = "DOTNET_RUNTIME_ID";
-
- public static Platform OperatingSystemPlatform { get; } = PlatformApis.GetOSPlatform();
-
- public static string OperatingSystemVersion { get; } = PlatformApis.GetOSVersion();
-
- public static string OperatingSystem { get; } = PlatformApis.GetOSName();
-
- public static string RuntimeArchitecture { get; } = GetArch();
-
- private static string GetArch()
- {
-#if NET45
- return Environment.Is64BitProcess ? "x64" : "x86";
-#else
- return RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
-#endif
- }
-
- public static string GetRuntimeIdentifier()
- {
- return
- Environment.GetEnvironmentVariable(OverrideEnvironmentVariableName) ??
- (GetRIDOS() + GetRIDVersion() + GetRIDArch());
- }
-
- private static string GetRIDArch()
- {
- return $"-{RuntimeArchitecture}";
- }
-
- private static string GetRIDVersion()
- {
- // Windows RIDs do not separate OS name and version by "." due to legacy
- // Others do, that's why we have the "." prefix on them below
- switch (OperatingSystemPlatform)
- {
- case Platform.Windows:
- return GetWindowsProductVersion();
- case Platform.Linux:
- if (string.IsNullOrEmpty(OperatingSystemVersion))
- {
- return string.Empty;
- }
-
- return $".{OperatingSystemVersion}";
- case Platform.Darwin:
- return $".{OperatingSystemVersion}";
- case Platform.FreeBSD:
- return $".{OperatingSystemVersion}";
- default:
- return string.Empty; // Unknown Platform? Unknown Version!
- }
- }
-
- private static string GetWindowsProductVersion()
- {
- var ver = Version.Parse(OperatingSystemVersion);
- if (ver.Major == 6)
- {
- if (ver.Minor == 1)
- {
- return "7";
- }
- else if (ver.Minor == 2)
- {
- return "8";
- }
- else if (ver.Minor == 3)
- {
- return "81";
- }
- }
- else if (ver.Major >= 10)
- {
- // Return the major version for use in RID computation without applying any cap.
- return ver.Major.ToString();
- }
- return string.Empty; // Unknown version
- }
-
- private static string GetRIDOS()
- {
- switch (OperatingSystemPlatform)
- {
- case Platform.Windows:
- return "win";
- case Platform.Linux:
- return OperatingSystem.ToLowerInvariant();
- case Platform.Darwin:
- return "osx";
- case Platform.FreeBSD:
- return "freebsd";
- default:
- return "unknown";
- }
- }
- }
-}
diff --git a/src/installer/test/HostActivation.Tests/HostActivation.Tests.csproj b/src/installer/test/HostActivation.Tests/HostActivation.Tests.csproj
index 892ad3cafb63f..95b8cfd9a9f6e 100644
--- a/src/installer/test/HostActivation.Tests/HostActivation.Tests.csproj
+++ b/src/installer/test/HostActivation.Tests/HostActivation.Tests.csproj
@@ -17,8 +17,7 @@
-
-
+
diff --git a/src/installer/test/HostActivation.Tests/HostVersionCompatibility.cs b/src/installer/test/HostActivation.Tests/HostVersionCompatibility.cs
index 67a4f70b9c9b7..afb0862fecde9 100644
--- a/src/installer/test/HostActivation.Tests/HostVersionCompatibility.cs
+++ b/src/installer/test/HostActivation.Tests/HostVersionCompatibility.cs
@@ -3,9 +3,9 @@
// See the LICENSE file in the project root for more information.
using Microsoft.DotNet.Cli.Build.Framework;
-using Microsoft.DotNet.PlatformAbstractions;
using System;
using System.IO;
+using System.Runtime.InteropServices;
using Xunit;
namespace Microsoft.DotNet.CoreSetup.Test.HostActivation
@@ -137,13 +137,11 @@ private void Old_Host_Is_Forward_Compatible_With_Latest_Runtime(TestProjectFixtu
private static bool IsRidSupported()
{
- Platform platform = RuntimeEnvironment.OperatingSystemPlatform;
-
// Some current Linux RIDs are not supported in 2.0\2.1; just test for Ubuntu 16.
return (
- platform == Platform.Windows ||
- platform == Platform.Darwin ||
- (platform == Platform.Linux && RuntimeEnvironment.GetRuntimeIdentifier() == "ubuntu.16.04-x64")
+ RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ||
+ RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
+ (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && RuntimeInformation.RuntimeIdentifier == "ubuntu.16.04-x64")
);
}
diff --git a/src/installer/test/TestUtils/TestUtils.csproj b/src/installer/test/TestUtils/TestUtils.csproj
index 5419bc266a1fb..35cb3e19e9d77 100644
--- a/src/installer/test/TestUtils/TestUtils.csproj
+++ b/src/installer/test/TestUtils/TestUtils.csproj
@@ -13,7 +13,6 @@
-
diff --git a/src/libraries/Common/tests/TestUtilities.Unicode/TestUtilities.Unicode.csproj b/src/libraries/Common/tests/TestUtilities.Unicode/TestUtilities.Unicode.csproj
index a3eaba2cfc48d..5f241043489c3 100644
--- a/src/libraries/Common/tests/TestUtilities.Unicode/TestUtilities.Unicode.csproj
+++ b/src/libraries/Common/tests/TestUtilities.Unicode/TestUtilities.Unicode.csproj
@@ -47,7 +47,6 @@
-
diff --git a/src/mono/netcore/gen-xunit-runner/Program.cs b/src/mono/netcore/gen-xunit-runner/Program.cs
index a73bbecdfd528..1bd127cef1f11 100644
--- a/src/mono/netcore/gen-xunit-runner/Program.cs
+++ b/src/mono/netcore/gen-xunit-runner/Program.cs
@@ -283,7 +283,6 @@ static int Main (string[] args)
args = args.Where (s => s != String.Empty).Concat (extra_args).ToArray ();
// Despite a lot of effort, couldn't get dotnet to load these assemblies from the sdk dir, so copy them to our binary dir
-// File.Copy ($"{sdkdir}/Microsoft.DotNet.PlatformAbstractions.dll", AppContext.BaseDirectory, true);
File.Copy ($"{sdkdir}/TestUtilities.dll", AppContext.BaseDirectory, true);
File.Copy ($"{sdkdir}/Microsoft.DotNet.XUnitExtensions.dll", AppContext.BaseDirectory, true);