DependencyResolutionException while using Autofac & SMS
Hello,
After start using SMS in Host configuration, I have been having below exceptions.
Exception 1: DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IGrainStorage (DelegateActivator), Services = [Orleans.Storage.IGrainStorage], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope Exception 2: DependencyResolutionException: A delegate registered to create instances of 'Orleans.Storage.IGrainStorage' returned null.
Code Snippet:
var builder = new SiloHostBuilder()
.Configure
Startup:
public static IServiceProvider ConfigureServices(IServiceCollection services)
{
var builder = new ContainerBuilder();
builder.Populate(services);
builder.RegisterModule
Thanks Team. Closing this issue as it worked fine after correcting memorygrainstorage configuration.
I have similar issue with ado storage. Can you please explain what is were wrong in your configuration? Thanks
After adding memorygrainstorageasdefault configuration, it worked. .AddMemoryGrainStorageAsDefault()
I think the failure is due to missing config on Default grain storage. @srinathgnath is trying to configure memory grain storage, so they should call AddMemoryGrainStorageAsDefault.
@ifle if you want to use Ado Storage, then you should call AddAdoGrainStorageAsDefault
@srinathgnath @xiazen Thanks a lot. Adding AddMemoryGrainStorageAsDefault is fixed this error. Please add the configuration validation, that will very helpful.
As @xiazen said, may be you should call AddAdoGrainStorageAsDefault as you are implementing adonet storage. COuld you please post your silohost adonet configuration. Now when I tried ado.net, getting below exceptions:
- OrleansLifecycleCanceledException: Lifecycle start canceled due to errors at stage 10000
- InvalidOperationException: Sequence contains no matching element