Fix reverse connection mode in macOS (#2104)
authorSung Yoon Whang <suwhang@microsoft.com>
Tue, 30 Mar 2021 23:20:32 +0000 (16:20 -0700)
committerGitHub <noreply@github.com>
Tue, 30 Mar 2021 23:20:32 +0000 (16:20 -0700)
src/Tools/Common/ReversedServerHelpers/ReversedServerHelpers.cs

index 2e5890dc6963f53770f9399d78ded724e15dd0fd..f98961183dd1da85f58356c66d892dd5b1e53359 100644 (file)
@@ -225,9 +225,9 @@ namespace Microsoft.Internal.Common.Utils
             }
             else if (!string.IsNullOrEmpty(portName))
             {
-                ReversedDiagnosticsServer server = new ReversedDiagnosticsServer(portName);
-                server.Start();
                 string fullPort = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? portName : Path.GetFullPath(portName);
+                ReversedDiagnosticsServer server = new ReversedDiagnosticsServer(fullPort);
+                server.Start();
                 Console.WriteLine($"Waiting for connection on {fullPort}");
                 Console.WriteLine($"Start an application with the following environment variable: DOTNET_DiagnosticPorts={fullPort}");