I have a situation where my codebase is stuck in .Net 4.7.2 for now but I need to push some notifications on a Website which is built on Asp.Core 2.2.
Across the system we use SignalR 2.4.1 but it is completely re-written in .Net Core.
I tried hosting it in the same app without success. Owin does not seem to be happy.
Has anyone had any success with it or has any suggestion?
There has to be a way for projects migrating from .Net to Core. Thanks
Ok so after along night I got a solution to this issue.
First just to make my setup clear. There is an API project targetting .Net 4.7.2 which is broadcasting some messages via a SignalR 2.4.1 Hub. There are some other Asp.Net 4.7.2 Projects consuming those Hubs which are working fine. And also there is a new website build in .Net Core but targetting 4.7.2 framework.
The solution I ended up is essentially hosting an OWIN pipeline within the AspCore Pipeline.
First I needed to install the following packages:
I also added a new extension method for the Core IApplicationBuilder interface that sets up OWIN on the same pipeline:
Then in the Startup class of the Core project, in the Configure method I was able to use my extension and register SignalR hubs to it like this:
Startup.cs
This way we can add more middlewares to the OWIN pipeline if we need to for whatever reasons.
I hope this helps.