in net 8 min api its:
builder.Services.AddSignalR();
...
app.MapHub<MyHub>("/myHub");
note: the signal/r library can not be compiled to native aot and is not supported. you can use websockets. see:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot?view=aspnetcore-8.0