3

我正在尝试使用以下方法安装 SignalR:

Install-Package Microsoft.AspNet.SignalR -pre

我收到一条错误消息,指出 Nuget 无法添加Microsfot.Web.Infrastructure引用。有人知道为什么会这样吗?下面是完整的输出:

PM> Install-Package Microsoft.AspNet.SignalR -pre
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.JS (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'jQuery (≥ 1.6.4)'.
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.SystemWeb (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.Owin (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.Core (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.4)'.
Attempting to resolve dependency 'Owin (≥ 1.0)'.
Attempting to resolve dependency 'Microsoft.Owin.Host.SystemWeb (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
You are downloading Microsoft.AspNet.SignalR.Core from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/aspnet_and_web_tools_2012_EULA_ENU.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.AspNet.SignalR.Core 1.0.0-rc1'.
Successfully installed 'Owin 1.0'.
You are downloading Microsoft.AspNet.SignalR.Owin from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/aspnet_and_web_tools_2012_EULA_ENU.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.AspNet.SignalR.Owin 1.0.0-rc1'.
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'.
Successfully added 'Microsoft.AspNet.SignalR.Core 1.0.0-rc1' to OProject.
Successfully added 'Owin 1.0' to OProject.
Successfully added 'Microsoft.AspNet.SignalR.Owin 1.0.0-rc1' to OProject.
Value does not fall within the expected range.
Successfully uninstalled 'Microsoft.Web.Infrastructure 1.0.0.0'.
Successfully uninstalled 'Microsoft.AspNet.SignalR.Owin 1.0.0-rc1'.
Successfully uninstalled 'Owin 1.0'.
Successfully uninstalled 'Microsoft.AspNet.SignalR.Core 1.0.0-rc1'.
Install failed. Rolling back...
Install-Package : Failed to add reference to 'Microsoft.Web.Infrastructure'.
At line:1 char:16
+ Install-Package <<<<  Microsoft.AspNet.SignalR -pre
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
4

2 回答 2

1

我遇到过同样的问题。对我来说,似乎我已经有了包的目录,但里面没有 DLL 文件。这是我解决它的方法:

  1. 删除 Microsoft.Web.Infrastructure 的本地目录,例如:

c:\MySolution\packages\Microsoft.Web.Infrastructure.1.0.0.0

  1. 重新运行 NuGet 包(例如 SignalR)的安装。
于 2013-04-16T21:33:22.213 回答
1

确保您也在运行最新的 Nuget。你是用VS2012还是VS2010

于 2013-01-14T22:52:41.277 回答