Aspnetcore: Custom CircuitHandler - overridden method never gets called

Created on 6 Sep 2019  路  1Comment  路  Source: dotnet/aspnetcore

I have created a simple class which inherits from CircuitHandler and it overrides OnConnectionUpAsync.
Registered:
C# public void ConfigureServices(IServiceCollection services) { ... services.AddServerSideBlazor(); services.AddScoped<CircuitHandlerComponent>(); .. }
And injected in a razor page like this: @inject CircuitHandlerComponent CircuitHandlerComponent

Now I hit F5 in VS, but the problem is , the overridden method never gets called!?

area-blazor question

Most helpful comment

Thanks for contacting us.
@Legends, please try to register your handler as a CircuitHandle:
services.AddScoped<CircuitHandler, CircuitHandlerComponent>();

>All comments

Thanks for contacting us.
@Legends, please try to register your handler as a CircuitHandle:
services.AddScoped<CircuitHandler, CircuitHandlerComponent>();

Was this page helpful?
0 / 5 - 0 ratings