Try to get UnixDomainSocketEndPoint from System.Core if not found in System.Net.Socke...
authorIlia <ki.stfu@gmail.com>
Wed, 12 Feb 2020 18:58:30 +0000 (21:58 +0300)
committerGitHub <noreply@github.com>
Wed, 12 Feb 2020 18:58:30 +0000 (10:58 -0800)
Fixes #821

src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs

index 079699c16afb7ef58da3a857f661dba8f05d81d1..dd1105fb61f2db08c45e443503efa9e7f2b6b880 100644 (file)
@@ -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.");