Unable to resolve Orleans.Runtime.IKeyedServiceCollection`2[System.Type,Orleans.Runtime.Placement.IPlacementDirector]
dmitrig89 opened this issue · comments
When adding StashBox to a project using Microsoft Orleans, the host is unable to resolve the following type:
Orleans.Runtime.IKeyedServiceCollection`2[System.Type,Orleans.Runtime.Placement.IPlacementDirector]
The following versions were used to when encountering this issue:
Microsoft.Extensions.Hosting Version=7.0.1
Microsoft.Orleans.Server Version=7.1.1
Stashbox.Extensions.Hosting Version=4.6.0
The simplest reproduction of this issue can be seen in the following example:
using Microsoft.Extensions.Hosting;
await Host.CreateDefaultBuilder(args)
.UseOrleans(siloBuilder =>
{
siloBuilder.UseLocalhostClustering();
})
.RunConsoleAsync();
This code runs fine and starts up an instance of an Orleans Silo on a localhost.
When adding stashbox, the as seen below, the following error is produced:
using Microsoft.Extensions.Hosting;
await Host.CreateDefaultBuilder(args)
.UseStashbox()
.UseOrleans(siloBuilder =>
{
siloBuilder.UseLocalhostClustering(); ;
})
.RunConsoleAsync();
System.InvalidOperationException: No service for type 'Orleans.Runtime.IKeyedServiceCollection`2[System.Type,Orleans.Runtime.Placement.IPlacementDirector]' has been registered.
Hi @dmitrig89, thank you for reporting this!
I've found the root cause and fixed it in Stashbox v5.8.1
. I've also published a new Stashbox.Extensions.Hosting
package with the version v4.6.1
.
Let me know if you have further issues!
Amazing!!!
Thanks @z4kn4fein.
I can confirm this no longer happens on v5.8.1
Very quick work, much appreciated.