SignalR 不能与 .Net Core 一起使用 [英] SignalR cannot be used with .Net Core

查看:42
本文介绍了SignalR 不能与 .Net Core 一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 C# Asp.Net 核心 项目中使用 NuGet 包管理器安装 SignalR,但我收到了 SignalR 与 .net 核心不兼容的错误,真的不支持了吗?或者我可以做些什么来让它工作?(如果提到这一点很重要,我正在使用 VS2017).错误:

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:TestTest.WebAPITest.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'.

更新:

用于 ASP.Net Core 的 SignalR 目前 (01.01.2018) 在 NuGet 中作为 alpha 版本提供.

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.信号R/

SignalR 现在可用于 ASP.Net Core 2.1

SignalR is now available for ASP.Net Core 2.1

推荐答案

SignalR 2 是为 .NET Framework 构建的,而不是为 .NET Core 构建的.他们仍在为 .NET Core 开发 SignalR.

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

ASP.NET Core 路线图的 旧修订版显示 SignalR 作为一部分ASP.NET Core 1.2.最新修订版没有提到 SignalR(或任何框架),但确实提及 1.2 计划于 2017 年第二季度发布.

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.

一个视频,Microsoft 人员在其中讨论了 ASP.NET Core 中的 SignalR.它有一个小时长,所以我不会为你看.但也许里面有一些有用的信息.

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.

这篇关于SignalR 不能与 .Net Core 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆