2013-12-19 82 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>