radu-matei / websocket-manager

Real-Time library for ASP .NET Core
https://radu-matei.com/blog/real-time-aspnet-core/
MIT License
452 stars 183 forks source link

WebSocketManagerMiddleWare exception #51

Closed tomitrescak closed 6 years ago

tomitrescak commented 6 years ago

When trying to use your package with latest .NET Core I am receiving this error

Message "A suitable constructor for type 'WebSocketManager.WebSocketManagerMiddleware' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor."   string

on this line

 public static IApplicationBuilder MapWebSocketManager(this IApplicationBuilder app,
                                                              PathString path,
                                                              WebSocketHandler handler)
{
    return app.Map(path, (_app) => _app.UseMiddleware<WebSocketManagerMiddleware>(handler)); // here
}
tomitrescak commented 6 years ago

Nevermind ... I forgot to put services.AddWebSocketManager();