From a8146914cca24b701e234af78b72c19333f24414 Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Thu, 3 Jul 2025 13:30:14 -0700 Subject: [PATCH 01/11] part 1: adding better diagnostic messages for too-long TMPDIR on Linux --- .../DiagnosticsIpc/IpcTransport.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index 7d4fb0a909..bed4450120 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -332,8 +332,16 @@ public static string GetDefaultAddress(int pid) string msg = $"Unable to connect to Process {pid}."; if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { + int total_length = 26 + IpcRootPath.Length + pid.ToString().Length; + if (total_length > 108) // This isn't perfect as we don't know the disambiguation key length. However it should catch most cases. + { + msg += "The total length of the diagnostic socket path may exceed 108 characters. " + + $"Please ensure that the target process has a shorter {IpcRootPath} path, " + + "or set the TMPDIR environment variable to a shorter path.\n"; + } msg += $" Please verify that {IpcRootPath} is writable by the current user. " + "If the target process has environment variable TMPDIR set, please set TMPDIR to the same directory. " + + "Please also ensure that the target process has {temp}/dotnet-diagnostic-{pid}-{disambiguation_key}-socket shorter than 108 characters. " + "Please see https://aka.ms/dotnet-diagnostics-port for more information"; } throw new ServerNotAvailableException(msg); From 8c5c8feb61bb1ccf955986cd9257dfed6aa535a1 Mon Sep 17 00:00:00 2001 From: Rachel Date: Mon, 7 Jul 2025 18:15:44 -0700 Subject: [PATCH 02/11] Update src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs Co-authored-by: Noah Falk --- .../DiagnosticsIpc/IpcTransport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index bed4450120..deec9117ad 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -341,7 +341,7 @@ public static string GetDefaultAddress(int pid) } msg += $" Please verify that {IpcRootPath} is writable by the current user. " + "If the target process has environment variable TMPDIR set, please set TMPDIR to the same directory. " - + "Please also ensure that the target process has {temp}/dotnet-diagnostic-{pid}-{disambiguation_key}-socket shorter than 108 characters. " + + "Please also ensure that the target process has {TMPDIR}/dotnet-diagnostic-{pid}-{disambiguation_key}-socket shorter than 108 characters. " + "Please see https://aka.ms/dotnet-diagnostics-port for more information"; } throw new ServerNotAvailableException(msg); From a66bc92d963562812bac1a02c8edd4c9e68c30fb Mon Sep 17 00:00:00 2001 From: Rachel Date: Mon, 7 Jul 2025 18:17:55 -0700 Subject: [PATCH 03/11] Update IpcTransport.cs --- .../DiagnosticsIpc/IpcTransport.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index deec9117ad..f09275d9aa 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -336,8 +336,7 @@ public static string GetDefaultAddress(int pid) if (total_length > 108) // This isn't perfect as we don't know the disambiguation key length. However it should catch most cases. { msg += "The total length of the diagnostic socket path may exceed 108 characters. " + - $"Please ensure that the target process has a shorter {IpcRootPath} path, " + - "or set the TMPDIR environment variable to a shorter path.\n"; + "Try setting the TMPDIR environment variable to a shorter path"; } msg += $" Please verify that {IpcRootPath} is writable by the current user. " + "If the target process has environment variable TMPDIR set, please set TMPDIR to the same directory. " From 2dc5ff61efeb052251aba0be62592b80aea43e9a Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Tue, 8 Jul 2025 18:14:18 -0700 Subject: [PATCH 04/11] updating with better length number and consolidating format strings --- .../DiagnosticsIpc/IpcTransport.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index f09275d9aa..644d3e7730 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -221,9 +221,16 @@ internal class PidIpcEndpoint : IpcEndpoint { public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; - + + // Format strings as private readonly members + private static readonly string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; + private static readonly string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; + private static readonly string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; + private static readonly string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; + private static readonly string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; + private int _pid; - private IpcEndpointConfig _config; + private IpcEndpointConfig _config; /// /// Creates a reference to a .NET process's IPC Transport @@ -271,11 +278,11 @@ private static bool TryGetDefaultAddress(int pid, out string defaultAddress) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - defaultAddress = $"dotnet-diagnostic-{pid}"; + defaultAddress = string.Format(_defaultAddressFormatWindows, pid); try { - string dsrouterAddress = Directory.GetFiles(IpcRootPath, $"dotnet-diagnostic-dsrouter-{pid}").FirstOrDefault(); + string dsrouterAddress = Directory.GetFiles(IpcRootPath, string.Format(_dsrouterAddressFormatWindows, pid)).FirstOrDefault(); if (!string.IsNullOrEmpty(dsrouterAddress)) { defaultAddress = dsrouterAddress; @@ -287,11 +294,11 @@ private static bool TryGetDefaultAddress(int pid, out string defaultAddress) { try { - defaultAddress = Directory.GetFiles(IpcRootPath, $"dotnet-diagnostic-{pid}-*-socket") // Try best match. + defaultAddress = Directory.GetFiles(IpcRootPath, string.Format(_defaultAddressFormatNonWindows, pid)) // Try best match. .OrderByDescending(f => new FileInfo(f).LastWriteTime) .FirstOrDefault(); - string dsrouterAddress = Directory.GetFiles(IpcRootPath, $"dotnet-diagnostic-dsrouter-{pid}-*-socket") // Try best match. + string dsrouterAddress = Directory.GetFiles(IpcRootPath, string.Format(_dsrouterAddressFormatNonWindows, pid)) // Try best match. .OrderByDescending(f => new FileInfo(f).LastWriteTime) .FirstOrDefault(); @@ -332,7 +339,7 @@ public static string GetDefaultAddress(int pid) string msg = $"Unable to connect to Process {pid}."; if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - int total_length = 26 + IpcRootPath.Length + pid.ToString().Length; + int total_length = string.Format(_defaultAddressLengthString, IpcRootPath, pid).Length; if (total_length > 108) // This isn't perfect as we don't know the disambiguation key length. However it should catch most cases. { msg += "The total length of the diagnostic socket path may exceed 108 characters. " + @@ -356,7 +363,7 @@ public static bool IsDefaultAddressDSRouter(int pid, string address) address = address.Substring(IpcRootPath.Length); } - string dsrouterAddress = $"dotnet-diagnostic-dsrouter-{pid}"; + string dsrouterAddress = string.Format(_dsrouterAddressFormatWindows, pid); return address.StartsWith(dsrouterAddress, StringComparison.OrdinalIgnoreCase); } From 3dfd6a71a163ed4792951e8fb6b03d960cf5453d Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Tue, 8 Jul 2025 18:27:02 -0700 Subject: [PATCH 05/11] updating with better length number and consolidating format strings --- .../DiagnosticsIpc/IpcTransport.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index 644d3e7730..e2a1cb033e 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -222,12 +222,12 @@ internal class PidIpcEndpoint : IpcEndpoint public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; - // Format strings as private readonly members - private static readonly string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; - private static readonly string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; - private static readonly string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; - private static readonly string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; - private static readonly string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; + // Format strings as private const members + private static const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; + private static const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; + private static const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; + private static const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; + private static const string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; private int _pid; private IpcEndpointConfig _config; From 48b030bcc8a741b35cc336badd1680c8c66137bb Mon Sep 17 00:00:00 2001 From: Rachel Date: Tue, 8 Jul 2025 18:35:05 -0700 Subject: [PATCH 06/11] Update IpcTransport.cs --- .../DiagnosticsIpc/IpcTransport.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index e2a1cb033e..15f0d9342c 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -223,11 +223,11 @@ internal class PidIpcEndpoint : IpcEndpoint public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; // Format strings as private const members - private static const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; - private static const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; - private static const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; - private static const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; - private static const string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; + private const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; + private const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; + private const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; + private const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; + private const string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; private int _pid; private IpcEndpointConfig _config; From 22b1d46622435c73f61a14b85bdbefb9028a832f Mon Sep 17 00:00:00 2001 From: Rachel Date: Tue, 8 Jul 2025 18:59:07 -0700 Subject: [PATCH 07/11] Update IpcTransport.cs --- .../DiagnosticsIpc/IpcTransport.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index 15f0d9342c..f5f032d6ae 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -221,17 +221,14 @@ internal class PidIpcEndpoint : IpcEndpoint { public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; - // Format strings as private const members private const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; private const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; private const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; private const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; private const string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; - private int _pid; - private IpcEndpointConfig _config; - + private IpcEndpointConfig _config; /// /// Creates a reference to a .NET process's IPC Transport /// using the default rules for a given pid From deabcca8353b6771f8b0c933b865a94915a40097 Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Tue, 8 Jul 2025 18:33:45 -0700 Subject: [PATCH 08/11] updating with better length number and consolidating format strings --- .../DiagnosticsIpc/IpcTransport.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index f5f032d6ae..a9aa034855 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -221,7 +221,8 @@ internal class PidIpcEndpoint : IpcEndpoint { public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; - // Format strings as private const members + + // Format strings as private readonly members private const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; private const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; private const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; From 2ca07f4342cb67ba53a4b29ccf00486b8bf29798 Mon Sep 17 00:00:00 2001 From: rcj1 Date: Mon, 14 Jul 2025 09:30:19 -0700 Subject: [PATCH 09/11] restructuring string constants --- .../DiagnosticsIpc/IpcTransport.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index a9aa034855..6fb52b47e7 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -222,12 +222,11 @@ internal class PidIpcEndpoint : IpcEndpoint public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; - // Format strings as private readonly members + // Format strings as private const members private const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; private const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; - private const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-*-socket"; + private const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-{1}-socket"; private const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; - private const string _defaultAddressLengthString = "{0}dotnet-diagnostic-{1}-##########-socket"; private int _pid; private IpcEndpointConfig _config; /// @@ -292,7 +291,7 @@ private static bool TryGetDefaultAddress(int pid, out string defaultAddress) { try { - defaultAddress = Directory.GetFiles(IpcRootPath, string.Format(_defaultAddressFormatNonWindows, pid)) // Try best match. + defaultAddress = Directory.GetFiles(IpcRootPath, string.Format(_defaultAddressFormatNonWindows, pid, "*")) // Try best match. .OrderByDescending(f => new FileInfo(f).LastWriteTime) .FirstOrDefault(); @@ -337,7 +336,7 @@ public static string GetDefaultAddress(int pid) string msg = $"Unable to connect to Process {pid}."; if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - int total_length = string.Format(_defaultAddressLengthString, IpcRootPath, pid).Length; + int total_length = IpcRootPath.Length + string.Format(_defaultAddressFormatNonWindows, pid, "##########").Length; if (total_length > 108) // This isn't perfect as we don't know the disambiguation key length. However it should catch most cases. { msg += "The total length of the diagnostic socket path may exceed 108 characters. " + From e216559701c7269f07a6c133f608eaf1c9291c59 Mon Sep 17 00:00:00 2001 From: rcj1 Date: Mon, 14 Jul 2025 10:12:16 -0700 Subject: [PATCH 10/11] whitespace --- .../DiagnosticsIpc/IpcTransport.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index 6fb52b47e7..99b38a2026 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -221,7 +221,6 @@ internal class PidIpcEndpoint : IpcEndpoint { public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); public static string DiagnosticsPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$"; - // Format strings as private const members private const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; private const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; From b95a5663a7948228577398bb13586371a44e6bb0 Mon Sep 17 00:00:00 2001 From: Rachel Date: Tue, 15 Jul 2025 09:42:01 -0700 Subject: [PATCH 11/11] Update IpcTransport.cs --- .../DiagnosticsIpc/IpcTransport.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs index 99b38a2026..64056a5782 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs @@ -225,7 +225,7 @@ internal class PidIpcEndpoint : IpcEndpoint private const string _defaultAddressFormatWindows = "dotnet-diagnostic-{0}"; private const string _dsrouterAddressFormatWindows = "dotnet-diagnostic-dsrouter-{0}"; private const string _defaultAddressFormatNonWindows = "dotnet-diagnostic-{0}-{1}-socket"; - private const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-*-socket"; + private const string _dsrouterAddressFormatNonWindows = "dotnet-diagnostic-dsrouter-{0}-{1}-socket"; private int _pid; private IpcEndpointConfig _config; /// @@ -294,7 +294,7 @@ private static bool TryGetDefaultAddress(int pid, out string defaultAddress) .OrderByDescending(f => new FileInfo(f).LastWriteTime) .FirstOrDefault(); - string dsrouterAddress = Directory.GetFiles(IpcRootPath, string.Format(_dsrouterAddressFormatNonWindows, pid)) // Try best match. + string dsrouterAddress = Directory.GetFiles(IpcRootPath, string.Format(_dsrouterAddressFormatNonWindows, pid, "*")) // Try best match. .OrderByDescending(f => new FileInfo(f).LastWriteTime) .FirstOrDefault();