Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SignalR cannot be used with .Net Core

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

like image 702
Mohammed Noureldin Avatar asked Mar 11 '17 01:03

Mohammed Noureldin


3 Answers

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)

like image 192
NtFreX Avatar answered Oct 04 '22 07:10

NtFreX


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.

like image 38
mason Avatar answered Oct 04 '22 09:10

mason


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>
like image 39
user2819502 Avatar answered Oct 04 '22 08:10

user2819502