From dc180b2bbcded065d66c9f9c9930e325d7beb34d Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 12 Feb 2020 21:58:30 +0300 Subject: [PATCH] Try to get UnixDomainSocketEndPoint from System.Core if not found in System.Net.Sockets (#826) Fixes #821 --- .../DiagnosticsIpc/IpcClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs index 079699c16..dd1105fb6 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs @@ -9,6 +9,7 @@ using System.IO.Pipes; using System.Linq; using System.Net; using System.Net.Sockets; +using System.Reflection; using System.Runtime.InteropServices; using System.Security.Principal; @@ -127,7 +128,8 @@ namespace Microsoft.Diagnostics.NETCore.Client return new UnixDomainSocketEndPoint(path); #elif NETSTANDARD2_0 // UnixDomainSocketEndPoint is not part of .NET Standard 2.0 - var type = typeof(Socket).Assembly.GetType("System.Net.Sockets.UnixDomainSocketEndPoint"); + var type = typeof(Socket).Assembly.GetType("System.Net.Sockets.UnixDomainSocketEndPoint") + ?? Assembly.Load("System.Core").GetType("System.Net.Sockets.UnixDomainSocketEndPoint"); if (type == null) { throw new PlatformNotSupportedException("Current process is not running a compatible .NET Core runtime."); -- 2.34.1