dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.34k stars 9.98k forks source link

[Blazor] Registered service not able to be found using inject #26017

Open timheuer opened 4 years ago

timheuer commented 4 years ago

Describe the bug

Trying to integrate Steeltoe with Blazor app. When attempting to use the service registered, Blazor fails with: Error: System.InvalidOperationException: No service for type 'Steeltoe.Common.Http.Discovery.DiscoveryHttpMessageHandler' has been registered.

The docs to register a Steeltoe service: https://steeltoe.io/docs/2/discovery/discovering-services#using-httpclientfactory

This works in an ASP.NET MVC application but fails in the Blazor instance.

To Reproduce

Sample repro in this repo: https://github.com/timheuer/Azure-Spring-Cloud-Samples/tree/steeltoe/steeltoe-sample (steeltoe branch). You should be able to F5 this SLN using Visual Studio. When the Blazor apps launch, click Weather in the nav. See error. image

Exceptions (if any)

Error: System.InvalidOperationException: No service for type 'Steeltoe.Common.Http.Discovery.DiscoveryHttpMessageHandler' has been registered.

ghost commented 4 years ago

Thanks for contacting us. We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

ghost commented 4 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost commented 11 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.