1

I see from the documentation that the Hub class is in package Microsoft.AspNetCore.SignalR. However, when I look at the package in NuGet, it says it has been deprecated.

I see that the Hub class comes automatically in, say, a web API project, but how can I reference it in a class library (without using a deprecated package)?

0

1 Answer 1

1

From this article, you could find the signalR is included inside the Microsoft.AspNetCore.App shared framework.

So there is no need to install the package, just include the framework inside the proj as below:

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>
</Project>

Result:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.