1

我在安装 Breeze 时遇到了一些依赖问题。

我将 ASP.NET 和 Web Tools 2012.2 更新安装到 Visual Studio 2012 中,然后将 Angular 安装到一个新制作的 ASP.NET Web API 项目中,当我尝试安装 Breeze nuget 包时,它会出现此错误。

安装失败。回滚... 安装包:无法添加对“System.Web.Http.OData”的引用。在 line:1 char:16 + Install-Package <<<< Breeze.WebApi + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

这是来自命令行的完整安装尝试,包括它试图解决的所有依赖项。

Install-Package Breeze.WebApi
Attempting to resolve dependency 'Microsoft.AspNet.WebApi'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.WebHost (≥ 4.0.20710.0 && < 4.1)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 4.0.20710.0 && < 4.1)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (≥ 4.0.20710.0 && < 4.1)'.
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.0.20710.0 && < 2.1)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.6)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.OData'.
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.2.0 && < 6.0.0)'.
Attempting to resolve dependency 'System.Spatial (= 5.2.0)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.2.0)'.
Attempting to resolve dependency 'WebActivator'.
Attempting to resolve dependency 'EntityFramework (≥ 4.4 && < 6.0)'.
Attempting to resolve dependency 'Q'.
You are downloading Microsoft.AspNet.WebApi.OData from Microsoft....
Successfully installed 'Microsoft.AspNet.WebApi.OData 4.0.1'.
Successfully installed 'WebActivator 1.5.3'.
Successfully installed 'Q 0.9.2'.
Successfully installed 'Breeze.WebApi 1.2.8'.
Successfully removed 'Microsoft.AspNet.WebApi.OData 4.0.0' from CrashBangZoom.WebApi.
Install failed. Rolling back...
Install-Package : Failed to add reference to 'System.Web.Http.OData'.
At line:1 char:16
+ Install-Package <<<<  Breeze.WebApi
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
4

1 回答 1

0

我没有问题 - 我刚刚在 Windows 8 x64 机器上使用 NuGet 将 Angular(稳定)和 Breeze(稳定)安装到 TestMVC 项目中。在安装之前会显示一个接受提示(与 OData 相关),并且它确实使用 powershell 进行安装 - 因此您应该检查以确保已安装。

------- Installing...Breeze.WebApi 1.2.8 -------
Attempting to resolve dependency 'Microsoft.AspNet.WebApi'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.WebHost (≥ 4.0.20710.0 && < 4.1)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 4.0.20710.0 && < 4.1)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (≥ 4.0.20710.0 && < 4.1)'.
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.0.20710.0 && < 2.1)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.6)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.OData'.
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.2.0 && < 6.0.0)'.
Attempting to resolve dependency 'System.Spatial (= 5.2.0)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.2.0)'.
Attempting to resolve dependency 'WebActivator'.
Attempting to resolve dependency 'EntityFramework (≥ 4.4 && < 6.0)'.
Attempting to resolve dependency 'Q'.
Added file 'System.Web.Http.OData.dll' to folder 'Microsoft.AspNet.WebApi.OData.4.0.1\lib\net40'.
Added file 'System.Web.Http.Odata.xml' to folder 'Microsoft.AspNet.WebApi.OData.4.0.1\lib\net40'.
Added file 'Microsoft.AspNet.WebApi.OData.4.0.1.nuspec' to folder             'Microsoft.AspNet.WebApi.OData.4.0.1'.
Added file 'Microsoft.AspNet.WebApi.OData.4.0.1.nupkg' to folder 'Microsoft.AspNet.WebApi.OData.4.0.1'.
Successfully installed 'Microsoft.AspNet.WebApi.OData 4.0.1'.
Added file 'WebActivator.dll' to folder 'WebActivator.1.5.3\lib\net40'.
Added file 'WebActivator.1.5.3.nuspec' to folder 'WebActivator.1.5.3'.
Added file 'WebActivator.1.5.3.nupkg' to folder 'WebActivator.1.5.3'.
Successfully installed 'WebActivator 1.5.3'.
Added file 'q.js' to folder 'Q.0.9.2\content\Scripts'.
Added file 'q.min.js' to folder 'Q.0.9.2\content\Scripts'.
Added file 'NuGet.exe' to folder 'Q.0.9.2'.
Added file 'Q.0.9.2.nuspec' to folder 'Q.0.9.2'.
Added file 'Q.0.9.2.nupkg' to folder 'Q.0.9.2'.
Successfully installed 'Q 0.9.2'.
Added file 'BreezeWebApiConfig.cs.pp' to folder 'Breeze.WebApi.1.2.8\content\App_Start'.
Added file 'breeze.debug.js' to folder 'Breeze.WebApi.1.2.8\content\Scripts'.
Added file 'breeze.intellisense.js' to folder 'Breeze.WebApi.1.2.8\content\Scripts'.
Added file 'breeze.min.js' to folder 'Breeze.WebApi.1.2.8\content\Scripts'.
Added file 'Breeze.WebApi.dll' to folder 'Breeze.WebApi.1.2.8\lib'.
Added file 'Irony.dll' to folder 'Breeze.WebApi.1.2.8\lib'.
Added file 'readme.txt' to folder 'Breeze.WebApi.1.2.8'.
Added file 'install.ps1' to folder 'Breeze.WebApi.1.2.8\tools'.
Added file 'Breeze.WebApi.1.2.8.nuspec' to folder 'Breeze.WebApi.1.2.8'.
Added file 'Breeze.WebApi.1.2.8.nupkg' to folder 'Breeze.WebApi.1.2.8'.
Successfully installed 'Breeze.WebApi 1.2.8'.
Removed reference 'System.Web.Http.OData.dll' from project 'MvcApplication1'
Added file 'packages.config'.
Successfully removed 'Microsoft.AspNet.WebApi.OData 4.0.0' from MvcApplication1.
Added reference 'System.Web.Http.OData' to project 'MvcApplication1'
Added file 'packages.config'.
Successfully added 'Microsoft.AspNet.WebApi.OData 4.0.1' to MvcApplication1.
Added reference 'WebActivator' to project 'MvcApplication1'
Added file 'packages.config'.
Successfully added 'WebActivator 1.5.3' to MvcApplication1.
Added file 'q.min.js' to folder 'Scripts'.
Added file 'Scripts\q.min.js' to project 'MvcApplication1'
Added file 'q.js' to folder 'Scripts'.
Added file 'Scripts\q.js' to project 'MvcApplication1'
Added file 'packages.config'.
Successfully added 'Q 0.9.2' to MvcApplication1.
Added file 'breeze.min.js' to folder 'Scripts'.
Added file 'Scripts\breeze.min.js' to project 'MvcApplication1'
Added file 'breeze.intellisense.js' to folder 'Scripts'.
Added file 'Scripts\breeze.intellisense.js' to project 'MvcApplication1'
Added file 'breeze.debug.js' to folder 'Scripts'.
Added file 'Scripts\breeze.debug.js' to project 'MvcApplication1'
Added file 'BreezeWebApiConfig.cs' to folder 'App_Start'.
Added file 'App_Start\BreezeWebApiConfig.cs' to project 'MvcApplication1'
Added reference 'Breeze.WebApi' to project 'MvcApplication1'
Added reference 'Irony' to project 'MvcApplication1'
Added file 'packages.config'.
Successfully added 'Breeze.WebApi 1.2.8' to MvcApplication1.
Executing script file 'C:\Users\andrew\Documents\Visual Studio     2012\Projects\packages\Breeze.WebApi.1.2.8\tools\install.ps1'.
Removed file 'System.Web.Http.OData.dll' to folder 'C:\Users\andrew\Documents\Visual Studio 2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0\lib\net40'.
Removed file 'System.Web.Http.Odata.xml' to folder 'C:\Users\andrew\Documents\Visual Studio     2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0\lib\net40'.
Removed folder 'C:\Users\andrew\Documents\Visual Studio 2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0\lib\net40'.
Removed folder 'C:\Users\andrew\Documents\Visual Studio 2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0\lib'.
Removed file 'Microsoft.AspNet.WebApi.OData.4.0.0.nuspec' to folder 'C:\Users\andrew\Documents\Visual Studio 2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0'.
Removed file 'Microsoft.AspNet.WebApi.OData.4.0.0.nupkg' to folder 'C:\Users\andrew\Documents\Visual Studio 2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0'.
Removed folder 'C:\Users\andrew\Documents\Visual Studio 2012\Projects\packages\Microsoft.AspNet.WebApi.OData.4.0.0'.
Successfully uninstalled 'Microsoft.AspNet.WebApi.OData 4.0.0'.
==============================
于 2013-04-10T13:36:50.483 回答