9
votes

I am trying to install SignalR using NuGet package manager in my C# Asp.Net core project, but I get this error that SignalR is not compatible with .net core, is it really not supporter yet? or can I do something to get it work? (I am using VS2017 if it was important to mention that). The error:

Restoring packages for D:\Test\Test.WebAPI\Test.WebAPI.csproj...
Package Microsoft.AspNet.SignalR.Core 2.2.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.AspNet.SignalR.Core 2.2.1 supports: net45 (.NETFramework,Version=v4.5)
Package Owin 1.0.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Owin 1.0.0 supports: net40 (.NETFramework,Version=v4.0)
Package Microsoft.Owin 2.1.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Owin 2.1.0 supports:
  - net40 (.NETFramework,Version=v4.0)
  - net45 (.NETFramework,Version=v4.5)
Package Microsoft.Owin.Security 2.1.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Owin.Security 2.1.0 supports: net45 (.NETFramework,Version=v4.5)
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Package restore failed. Rolling back package changes for 'Test.WebAPI'.

UPDATE:

SignalR for ASP.Net Core is at the moment (01.01.2018) available in NuGet as alpha version.

https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR/

UDPATE 01.06.2018:

SignalR is now available for ASP.Net Core 2.1

7
SignalR is not yet part of ASP.Net Core, but it's on the roadmap. - DavidG
You can try the beta I guess. - DavidG
@MohammedNoureldin Web Sockets are already in .NET Core I believe. But not SignalR. So if you want web sockets, you'll need to roll your own implementation. Or just use .NET Framework for now. - mason
You know the source is available right? You could theoretically download it and see what state it's in and even begin using it. I wouldn't trust it for production purposes of course. - mason
Latest as of Microsoft Build 2017 (around May 12, 2017): SignalR for .NET Core is still under development targeting preview around Q3 2017 and release around Q4 2017. Github site is github.com/aspnet/SignalR and Build presentation is at channel9.msdn.com/Events/Build/2017/B8078 from which you can also see the slide deck - Seafish

7 Answers

11
votes

SignalR 2 is built for .NET Framework, not for .NET Core. They are still working on SignalR for .NET Core.

An old revision of the ASP.NET Core Roadmap shows SignalR as part of ASP.NET Core 1.2. The latest revision makes no reference to SignalR (or any of the framework) but does mention 1.2 is scheduled for Q2 2017.

There's a video where the Microsoft guys are discussing SignalR in ASP.NET Core. It's an hour long so I'm not going to watch it for you. But perhaps some useful information is in there.

4
votes

I'm currently working on a .net core / angular 4 project using signalr.

There are a handful of seed examples on google, but one thing which may trip most people up trying to download signalr via nuget is the fact that it's a different package repo - you need to update Nuget.config in your solution to reference the more bleeding edge repo:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>
4
votes

SignalR for asp.net core

EDIT: SignalR for asp.net core has been released with .net standard 2.1.

This package targets .net standard 2.0 and is still in the alpha state.

It doesn't seem like a stable release is out before .net standard 2.1.

enter image description here

The packages can be found on myget.

If you load balance your signalr hub you can use redis as backpane.


SignalR for asp.net

And there is also the SignalR package for the .net framework which allready has a stable release. It can be found on nuget.

For load balancing the following backpane types are supported:

  • Azure Service Bus
  • Redis
  • SQL Server

SignalR.Server for asp.net core (update 18.09.2017: not available anymore)

Do not use this package!

This is the deprecated package which targets .net 4.5.1 and .net standard 1.6. No stable package has and will ever be released.

The preview packages can be found on myget.

If you load balance your signalr hub you can use sql server as backpane. (But the implementation is broken)

2
votes

That is correct. SignalR is built on OWIN, which is compatible with asp.net core if you target the full framework, but not dotnet core.

1
votes

I recently migrated an MVC5 application that used SignalR to ASP.NET Core 1.1 (netcoreapp1.1). I found an unofficial package (Gray.Microsoft.AspNetCore.SignalR.Server) that worked straight almost without any changes to my existing code.

csproj file

<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="1.0.2" />
<PackageReference Include="Gray.Microsoft.AspNetCore.SignalR.Server" Version="0.2.0-alpha1" />

Startup - ConfigureServices method

services.AddSignalR();

Startup - Configure method

app.UseWebSockets();
app.UseSignalR();
0
votes

The following packages can be found on NuGet.

Microsoft.AspNetCore.SignalR 1.0.0-alpha1-final Components for providing real-time bi-directional communication across the Web.

Microsoft.AspNetCore.SignalR.Redis 1.0.0-alpha1-final Redis for ASP.NET Core SignalR.

The packages supported .NETSTandard,Version=v2.0 Now. I used the packages in my projects. Angular 4 + SignalR

0
votes

SignalR is introduced with .NET Core Here is the link for implementation https://www.youtube.com/watch?v=1TrttIkbs6c