{
"ErrorMessage": "Error when dispatching 'OnDisconnectedAsync' on hub",
"BuildRetry": true,
"ExcludeConsoleLog": false
}
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateScope()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.CreateScope()
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.CreateAsyncScope(IServiceScopeFactory serviceScopeFactory)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1325148
Build error leg or test failing: Tests: Helix x64 Subset 2 / Microsoft.AspNetCore.SignalR.Client.Tests--net11.0
Pull request: #65694
Error Message
{ "ErrorMessage": "Error when dispatching 'OnDisconnectedAsync' on hub", "BuildRetry": true, "ExcludeConsoleLog": false }Description
TestServerTests.LongPollingWorksfails intermittently when the test host shuts down andOnDisconnectedAsyncraces withIServiceProviderdisposal. TheHttpConnectionDispatcher.ProcessDeleteAsyncfire-and-forgets server-side connection disposal, so when the host tears down,DefaultHubDispatcher.OnDisconnectedAsynccan attempt to callCreateAsyncScope()on an already-disposedServiceProvider, throwingObjectDisposedException.Stack trace:
Fix in progress: #65457 catches
ObjectDisposedExceptionat the DI boundary inDefaultHubDispatcher.OnDisconnectedAsync.Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1325148
Error message validated:
[Error when dispatching 'OnDisconnectedAsync' on hub]Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 3/7/2026 10:12:12 PM UTC
Report
Summary