2013-12-19 83 views
1

我试图从安装的NuGet和Microsoft.AspNet.SignalR收到以下错误:错误安装包Microsoft.AspNet.SignalR

'Microsoft.Owin.Security 2.0.2'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, conta ct the package author.

有没有人遇到过这一点,并且知道解决办法是什么?

回答

4

SignalR 2.0不支持.net 4.0。既可以升级.net,也可以使用SignalR的1.x版本。

>Install-Package Microsoft.AspNet.SignalR -Version 1.1.3 

source

+0

我也这样做了,但是信号集线器不可见 – sai

+0

不可见?如果你能详细阐述一点,我将不胜感激。 – Mads

0

另一种选择是升级从框架4.0至框架4.5。

转到Visual Studio菜单中的“网站>开始选项”,然后将您的“目标框架”更改为4.5。

还要确保controlRenderingCompatibilityVersion(如果使用)在你的web.config中也是4.5。

<system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <pages controlRenderingCompatibilityVersion="4.5" /> 
    </system.web>