Orleans 9.0 With Autofac IGrainExtension
- Dominant language
- C#
- Stars
- 10.9k
- Forks
- 2.1k
- Avg merge
- 13h 56m
- Merged PRs (30d)
- 351
Description
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

Is this some kind of incompability ? How can i do to avoid t his exception?
Contributor guide
Research direction
Start at CreateHostBuilder(args).Build().Run() and inspect the service registrations added by UseOrleans(), then trace the null descriptor into Autofac.Core.Activators.ProvidedInstance.ProvidedInstanceActivator. Done means determining whether the Orleans 9.0 and Autofac integration is incompatible and documenting a verified resolution or workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100