microsoft/migrating-aspnet-signalr
> Migrates the obsolete ASP.NET SignalR (Microsoft.AspNet.SignalR) to ASP.NET Core SignalR (Microsoft.AspNetCore.SignalR) for real-time communication. Use ONLY when Microsoft.AspNet.SignalR has been flagged as obsolete or deprecated and must be replaced — not for version-bump scenarios where Microsoft.AspNet.SignalR is still supported.
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-aspnet-signalr
Migrate real-time communication code from ASP.NET SignalR (Microsoft.AspNet.SignalR) to ASP.NET Core SignalR (Microsoft.AspNetCore.SignalR). The core changes are a new hub base class, endpoint routing instead of MapSignalR, removal of HubPipeline, and an updated client connection API. Most hub method signatures remain the same, but the server and client wiring changes significantly.
<PackageReference Include="Microsoft.AspNet.SignalR" Version="2.*" />
<PackageReference Include="Microsoft.AspNet.SignalR.Core" Version="2.*" />
<PackageReference Include="Microsoft.AspNet.SignalR.JS" Version="2.*" />
<PackageReference Include="Microsoft.AspNet.SignalR.SystemWeb" Version="2.*" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="{version-for-target-framework}" />
<!-- Optional: for MessagePack binary protocol support -->
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="{version}" />
Migration Progress:
- [ ] Step 1: Detect SignalR usage
- [ ] Step 2: Update project file references
- [ ] Step 3: Migrate hub classes
- [ ] Step 4: Update route configuration
- [ ] Step 5: Migrate client code
- [ ] Step 6: Handle removed features
- [ ] Step 7: Build and verify
Scan the project for:
using Microsoft.AspNet.SignalR; statementsHub or Hub<T>PersistentConnection subclassesHubPipelineModule implementationsMapSignalR() or MapHubs() calls in OWIN startup$.connection, $.hubConnection)Remove old packages and add the new package reference (see "Package Reference Changes" above). Remove jQuery SignalR scripts from wwwroot or bundleconfig if present.
using directive from Microsoft.AspNet.SignalR to Microsoft.AspNetCore.SignalRHub or Hub<T> — no rename neededClients.All.methodName(args) (dynamic) with Clients.All.SendAsync("methodName", args) or use a strongly typed hub interfaceHubPipelineModule implementations — use middleware or hub filters insteadReplace OWIN-based SignalR routing with ASP.NET Core endpoint routing:
// Old: in Startup.cs OwinStartup
app.MapSignalR();
// New: in Program.cs or Startup.cs
builder.Services.AddSignalR();
app.MapHub<ChatHub>("/chatHub");
Register each hub explicitly with MapHub<T> — there is no auto-discovery equivalent to MapSignalR().
JavaScript/TypeScript client — replace the jQuery SignalR client with @microsoft/signalr:
// Old
var connection = $.hubConnection();
var proxy = connection.createHubProxy('chatHub');
// New
const connection = new signalR.HubConnectionBuilder()
.withUrl("/chatHub")
.build();
.NET client — update the HubConnection builder:
// Old
var connection = new HubConnection("https://example.com/signalr");
var proxy = connection.CreateHubProxy("chatHub");
// New
var connection = new HubConnectionBuilder()
.WithUrl("https://example.com/chatHub")
.Build();
| ASP.NET SignalR | ASP.NET Core SignalR | Action |
|----------------|---------------------|--------|
| HubPipeline / HubPipelineModule | Not supported | Use hub filters (IHubFilter) or middleware instead |
| PersistentConnection | Not supported | Rewrite as a hub or use raw WebSockets |
| Automatic reconnection | Not built-in | Call .withAutomaticReconnect() on HubConnectionBuilder (JS) or implement retry logic (.NET client) |
| jQuery dependency | Removed | Use @microsoft/signalr npm package |
| GlobalHost.ConnectionManager | Not supported | Inject IHubContext<T> via DI to send messages from outside a hub |
| Dynamic client proxy | Removed | Use strongly typed hub interfaces or SendAsync |
dotnet build
/negotiateEnsure client calls use the exact method name string. ASP.NET Core SignalR is case-sensitive for method names by default.
ASP.NET Core SignalR does not automatically reconnect. Add .withAutomaticReconnect() on the JavaScript client or implement retry logic in the .NET client.
Replace GlobalHost.ConnectionManager.GetHubContext<T>() with constructor-injected IHubContext<T>. The global static resolver is not available in ASP.NET Core.
If using the MessagePack protocol, ensure all hub method parameter and return types are MessagePack-serializable. Add [Key] attributes or use contractless resolution.
Take microsoft/migrating-aspnet-signalr from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.