Jack Pettinger
Jack Pettinger

Reputation: 2755

SignalR Core client on ASP.NET Framework server

I have an existing application running .NET Framework 4.6.1, that uses SignalR version 2.3. The client version I'm using is 2.0, this has a jQuery dependency. This current setup uses SignalR cors as my web front end is on a different domain to my backend services which is where my hubs lie. To be honest it's all working fine and I'm happy with it, even though you could say it's old tech.

This application has been rewritten relatively recently, but at the time the project was started, SignalR on .Net Core didn't exist, or it might have been in alpha so it wasn't considered an option.

I now have the need to add a new project to the solution, a front end dashboard. Where I work, for new development we use angular, and .Net Core. I thought this would be a good opportunity to try to introduce these new techs into the solution. The plan is to have an angular project and use the @aspnet/signalr npm package, I'll be using Typescript.

Now, the problem (if you haven't guessed already). I can't seem to get my new shiny SignalR client to work with my old Framework SignalR server. The error message is very specific when the call to SignalR is made:

Error: Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server.

What are my options here? Am I going to have to upgrade the SignalR project and the projects that interact with SignalR to Core? Or is there something else that I can do I the meantime to give me more time to upgrade?

Upvotes: 0

Views: 2124

Answers (1)

Frank M
Frank M

Reputation: 1439

You have to use the Asp.Net Core Server with Asp.Net Core Client or use Asp.Net SignalR Server with Asp.Net SignalR Client. You cannot mix them, they won't work together.

Not sure of any work around for that. Checking the differences page it does say you can run CORE on .NET Framework 4.6.1 or later .NET Core 2.1 or later. You should still be able run Asp.Net SignalR on a server running .NET Framework 4.6.1 if that is available to you (yes, I know you said you are a angular/core shop).

Short of that... yes, you would need to rewrite your app for SignalR Core (server and client).

Upvotes: 0

Related Questions