Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access a disposed object. Object name: 'IServiceProvider'. #151

Open
EquineSolutions opened this issue Feb 21, 2023 · 2 comments
Open

Comments

@EquineSolutions
Copy link

I'm trying to use SignalR.Orleans in my cluster but when ever i add this line i get a Cannot access a disposed object.
Object name: 'IServiceProvider'.

//this line
siloBuilder.AddMongoDBGrainStorage(SignalROrleansConstants.SIGNALR_ORLEANS_STORAGE_PROVIDER);

//stacktrace
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Orleans.GrainReferences.GrainReferenceActivatorProvider.TryGet(GrainType grainType, GrainInterfaceType interfaceType, IGrainReferenceActivator& activator)
at Orleans.GrainReferences.GrainReferenceActivator.CreateActivator(GrainType grainType, GrainInterfaceType interfaceType)
at Orleans.GrainReferences.GrainReferenceActivator.CreateReference(GrainId grainId, GrainInterfaceType interfaceType)
at Orleans.GrainFactory.GetGrain(Type interfaceType, IdSpan grainKey, String grainClassNamePrefix)
at Orleans.GrainFactory.GetGrain[TGrainInterface](Int64 primaryKey, String grainClassNamePrefix)
at Orleans.Runtime.InternalClusterClient.GetGrain[TGrainInterface](Int64 primaryKey, String grainClassNamePrefix)
at Orleans.GrainFactoryExtensions.GetServerDirectoryGrain(IGrainFactory factory)
at SignalR.Orleans.OrleansHubLifetimeManager`1.Dispose()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.DisposeAsync()
--- End of stack trace from previous location ---
at Microsoft.Extensions.Hosting.Internal.Host.<g__DisposeAsync|16_0>d.MoveNext()
at Microsoft.Extensions.Hosting.Internal.Host.d__16.MoveNext()
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.d__4.MoveNext()
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Program.

$(String[] args) in /Users/apple/Desktop/equine solutions/Jcl/Jcl/Program.cs:line 174

@RemcoBlok
Copy link

Same error here. Works fine when using Memory grain storage and streaming providers, but fails with Azure Storage providers. See https://github.com/RemcoBlok/orleans-event-sourcing.

@dtrygodko
Copy link

Same with Redis grain storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants