I got error when created WebSocketManagerExtensions like this:
A suitable constructor for type
'CustomerManagementCore.WebSocketManager.WebSocketManagerMiddleware' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
public static IApplicationBuilder MapWebSocketManager(this IApplicationBuilder app,
return app.Map(path, (_app) => _app.UseMiddleware<WebSocketManagerMiddleware>(handler));
public WebSocketManagerMiddleware(RequestDelegate next,
_next = next;
_webSocketHandler = webSocketHandler;
From the error I would guess
WebSocketHandler was not added to the
IServicesCollection in your startup class. Once you add it to the services collection, it should be able to be injected as expected. Typically this is done in the
ConfigureServices method for an ASP.NET Core application created from the default templates.