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

Unable to resolve Orleans.Runtime.IKeyedServiceCollection`2[System.Type,Orleans.Runtime.Placement.IPlacementDirector] #132

Closed
dmitrig89 opened this issue Mar 28, 2023 · 2 comments
Assignees
Labels

Comments

@dmitrig89
Copy link

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.
@z4kn4fein
Copy link
Owner

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!

@z4kn4fein z4kn4fein self-assigned this Mar 29, 2023
@z4kn4fein z4kn4fein added the bug label Mar 29, 2023
@dmitrig89
Copy link
Author

Amazing!!!

Thanks @z4kn4fein.

I can confirm this no longer happens on v5.8.1

Very quick work, much appreciated.

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

No branches or pull requests

2 participants