Error: Failed to complete negotiation with the server: Error: Not Found

前端 未结 1 1113
心在旅途
心在旅途 2021-01-26 18:24

I\'m using SignalR with ASP.NET Boilerplate .NET Core 3.1 but I encounterd this problem

Error: Failed to complete negotiation with the server: Error: Not Found<

相关标签:
1条回答
  • 2021-01-26 18:53

    That error is for connecting to /signalr for AbpCommonHub, used by ABP for real-time notifications.
    ABP document: https://aspnetboilerplate.com/Pages/Documents/Notification-System#real-time-notifications

    You should restore endpoints.MapHub<AbpCommonHub>("/signalr");.

    app.UseEndpoints(endpoints =>
    {
        endpoints.MapHub<AbpCommonHub>("/signalr"); // Restore this
        endpoints.MapHub<MyChatHub>("/signalr-myChatHub");
        endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
        endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}");
    });
    

    By the way, you can remove app.UseSignalR(...);, which has been deprecated in favour of app.UseEndpoints(...);.

    0 讨论(0)
提交回复
热议问题