fix UnixDomainSocketEndPoint exception on Mono (#1518)
authorSung Yoon Whang <suwhang@microsoft.com>
Tue, 1 Sep 2020 23:39:31 +0000 (16:39 -0700)
committerGitHub <noreply@github.com>
Tue, 1 Sep 2020 23:39:31 +0000 (16:39 -0700)
src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/UnixDomainSocket.cs

index 4cf78a6fd5a81d85e9350324b37ffa44d2c8b25e..579bf831d4c3abd6def82a8de1324875ea64d7aa 100644 (file)
@@ -111,7 +111,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")
+                        ?? Type.GetType("System.Net.Sockets.UnixDomainSocketEndPoint, System.Core");
             if (type == null)
             {
                 throw new PlatformNotSupportedException("Current process is not running a compatible .NET runtime.");