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

Orleans 9.0 With Autofac IGrainExtension #9288

Open
BoasE opened this issue Jan 21, 2025 · 0 comments
Open

Orleans 9.0 With Autofac IGrainExtension #9288

BoasE opened this issue Jan 21, 2025 · 0 comments

Comments

@BoasE
Copy link

BoasE commented Jan 21, 2025

I upgraded a project to the current orleans version from 3.x
This project also uses autofac for dependency injection.

Now when I start the project, it throws a Argument.Null exception when calling
CreateHostBuilder(args).Build().Run(); and the source is Autofac.Core.Activators.ProvidedInstance.ProvidedInstanceActivator

After debugging into it I can see autofac tries to register the instance for IGrainExtensions

The code in the ProvidedInstanceActivator is and then register instance fails

 builder
                        .RegisterInstance(descriptor.ImplementationInstance) //Is Nulll
                        .As(descriptor.ServiceType)
                        .ConfigureLifecycle(descriptor.Lifetime, null);

The Registration was added by "UseOrleans()" and i dont have any Grainextensions by my own

In the debug view of the ServiceCollection I can see that it is indeed null

Image

Is this some kind of incompability ? How can i do to avoid t his exception?

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

1 participant