0

I am developing an asp.net core 3.1 application that loads up an assembly using Application Parts and reflection. This plugin assembly is also an asp.net core 3.1 application which is all working fine except it also has SignalR functionality within it. In the host application I have the service registered in Startup.cs like this:-

services.AddSignalR();

In the Configure method I would normally have something like this:-

endpoints.MapHub<MyHub>("/myHub");

But MyHub is a class from the plugin assembly. How can I map the hub when it could be of any type? I don't want to have this MyHub class in the host application, it can only be in the plugin application.

1 Answers1

-1

In your solution, you can create new .NET Core Library project which is referred to the main project.

In the library project, you can add this Nuget package:

Microsoft.AspNetCore.SignalR.Core

Then, creating your Hub class from there and mapping it from the Startup class.

Tân
  • 1
  • 15
  • 56
  • 102