Shi*_*iva 26 c# nuget asp.net-web-api
我正在尝试将Microsoft.AspNet.WebApiNuget包添加到C#类库项目中.这是项目源代码,以备您需要时使用.
当我在Visual Studio 2013中的Nuget包管理器控制台中执行以下命令时(其中包含最新的.NET 4.5)
PM> install-package Microsoft.AspNet.WebApi ErrandBoy.Web.Common
Run Code Online (Sandbox Code Playgroud)
我得到以下错误.
PM> install-package Microsoft.AspNet.WebApi ErrandBoy.Web.Common
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.WebHost (? 5.2.2 && < 5.3.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (? 5.2.2 && < 5.3.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (? 5.2.2)'.
Attempting to resolve dependency 'Newtonsoft.Json (? 6.0.4)'.
'Microsoft.AspNet.WebApi 5.2.2' already installed.
Adding 'Newtonsoft.Json 6.0.4' to ErrandBoy.Web.Common.
Successfully added 'Newtonsoft.Json 6.0.4' to ErrandBoy.Web.Common.
Adding 'Microsoft.AspNet.WebApi.Client 5.2.2' to ErrandBoy.Web.Common.
install-package : Failed to add reference to 'System.Net.Http'. Please make sure that it is in the Global Assembly Cache.
At line:1 char:1
+ install-package Microsoft.AspNet.WebApi ErrandBoy.Web.Common
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Run Code Online (Sandbox Code Playgroud)
具体的错误行如下.它似乎是在尝试添加对Adding的引用'Microsoft.AspNet.WebApi.Client 5.2.2'
Failed to add reference to 'System.Net.Http'. Please make sure that it is
in the Global Assembly Cache.
Run Code Online (Sandbox Code Playgroud)
我以前从来没有遇到过这样的错误.我确实在这个SO溢出问题上看到了类似的错误=> 安装ASP.NET Identity 2 Samples时出错,但是没有答案.
| 归档时间: |
|
| 查看次数: |
18596 次 |
| 最近记录: |