Signal R Self Host Server in .NET 6 Console or WPF App

DotNET Fan 271 Reputation points
2023-07-01T12:31:26.0533333+00:00

I am trying to implement an Asp.net core SignalR Server self-hosted within a .net6 console app or WPF app and most of my search lands where I have to add the below NuGet packages.

1.     Install the required NuGet packages: In your .NET console application project, install the following NuGet packages:

o   Microsoft.AspNetCore.SignalR

o   Microsoft.AspNetCore.SignalR.Core

o   Microsoft.AspNetCore.Http.Connections

o   Microsoft.Extensions.Hosting

But strangely when you browse the first three packages all the latest versions are deprecated.

In that case which are the latest libraries that need to be referenced for the self-hosting signalR server in.Net6 Console App?

 

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,053 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,737 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 69,426 Reputation points
    2023-07-01T17:59:48.33+00:00

    The institution of meta packages has reduced the need for individual nuget packages. Many of the separate Microsoft .net core nuget packages like the one you list, have been moved to main repo and are no longer separate packages.

    The project file for a .net core application now defines the runtime and the project sdk. The sdk define a meta package with several libraries from the main repo. The Microsoft.AspNetCore requires the Microsoft.NET.Sdk.Web

    the short answer, is you just need update project sdk in the .csproj.

    https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.