Aspnetcore: [Discussion] Removed `UseSignalR`, `UseConnections` and related methods

Created on 23 Mar 2020  路  3Comments  路  Source: dotnet/aspnetcore

This is the discussion issue for https://github.com/aspnet/Announcements/issues/412

Removed UseSignalR, UseConnections and related methods

In ASP.NET Core 3.0, we converted SignalR to use Endpoint Routing. As part of that we marked UseSignalR, UseConnections and some related methods (full list below) as obsolete. In ASP.NET Core 5.0 we will remove those methods entirely.

Version introduced

5.0.0-preview3

Old behavior

SignalR Hubs and Connection Handlers could be registered in the middleware pipeline using the UseSignalR or UseConnections methods.

New behavior

SignalR Hubs and Connection Handlers should be registered within UseEndpoints using the MapHub and MapConnectionHandler extension methods on IEndpointRouteBuilder.

Reason for change

The old methods had custom routing logic that didn't interact with other routing components in ASP.NET Core. In 3.0 we introduced a new general-purpose routing system (Endpoint Routing) and enabled SignalR to work with that. Switching to this model allows users to get the full benefits of endpoint routing.

Recommended action

Remove code that called UseSignalR or UseConnections from your Startup.Configure method. Replace it with calls to MapHub and MapConnectionHandler within the body of a call to UseEndpoints. In general, your previous MapHub/MapConnectionHandler calls can be transferred directly from the body of UseSignalR/UseConnections over to UseEndpoints with no change needed.

Category

ASP.NET

Affected APIs


Issue metadata

  • Issue type: breaking-change

Most helpful comment

Typo, thanks 馃槃

All 3 comments

Removed UseEndpoints? that's not correct, that's what we're supposed to be using.

Typo, thanks 馃槃

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fayezmm picture fayezmm  路  3Comments

Kevenvz picture Kevenvz  路  3Comments

markrendle picture markrendle  路  3Comments

UweKeim picture UweKeim  路  3Comments

FourLeafClover picture FourLeafClover  路  3Comments