Skip to content

Commit f26b79e

Browse files
Improved Server Addresses Collection Debugging (#54120)
Co-authored-by: joegoldman2 <[email protected]>
1 parent 983caa6 commit f26b79e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Servers/Kestrel/Core/src/Internal/ServerAddressesCollection.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ IEnumerator IEnumerable.GetEnumerator()
9797
return GetEnumerator();
9898
}
9999

100+
[DebuggerDisplay("Count = {Count}")]
101+
[DebuggerTypeProxy(typeof(PublicServerAddressesCollectionDebugView))]
100102
private sealed class PublicServerAddressesCollection : ICollection<string>
101103
{
102104
private readonly ServerAddressesCollection _addressesCollection;
@@ -169,6 +171,13 @@ private void ThrowIfReadonly()
169171
}
170172
}
171173

174+
private sealed class PublicServerAddressesCollectionDebugView(PublicServerAddressesCollection publicCollection)
175+
{
176+
private readonly PublicServerAddressesCollection _collection = publicCollection;
177+
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
178+
public string[] Items => _collection.ToArray();
179+
}
180+
172181
private sealed class ServerAddressesCollectionDebugView(ServerAddressesCollection collection)
173182
{
174183
private readonly ServerAddressesCollection _collection = collection;

0 commit comments

Comments
 (0)