diff --git a/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.cs b/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.cs index 72fc7685dffe90..4585e92a8ac9dc 100644 --- a/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.cs +++ b/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.cs @@ -437,6 +437,11 @@ public void RegisterForCancellation(CancellationToken cancellationToken) NetEventSource.Info(@this, $"GetAddrInfoExCancel returned error {cancelResult}"); } } + catch (ObjectDisposedException) + { + // There is a race between checking @this._completed and @this.DangerousAddRef and disposing from another thread. + // We lost the race. No further action needed. + } finally { if (needRelease)