Breeze.Server.WebApi2与MVC 5.1.1的Nuget包冲突?

时间:2014-02-13 15:38:12

标签: breeze

我正在尝试安装Breeze.Server.WebApi2 Nuget包,在将我的MVC包更新到当前的Nuget版本(5.1.1)后,我收到以下错误(如下所示)。我是否需要将MVC版本降级到(5.0.0)才能使当前的Breeze WebAPI2程序包运行?

PM> Install-Package Breeze.Server.WebApi2
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.OData (≥ 5.0 && < 6.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (≥ 5.0.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.11)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 5.0.0 && < 5.1)'.
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.6.0)'.
Attempting to resolve dependency 'System.Spatial (= 5.6.0)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.6.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.WebHost (≥ 5.0 && < 6.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 5.1.1 && < 5.2.0)'.
Attempting to resolve dependency 'Breeze.Server.ContextProvider (= 1.4.8)'.
Attempting to resolve dependency 'WebActivator'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
Installing 'Microsoft.AspNet.WebApi.OData 5.1.1'.
You are downloading Microsoft.AspNet.WebApi.OData from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_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.WebApi.OData 5.1.1'.
Installing 'Breeze.Server.ContextProvider 1.4.8'.
Successfully installed 'Breeze.Server.ContextProvider 1.4.8'.
Installing 'WebActivator 1.5.3'.
Successfully installed 'WebActivator 1.5.3'.
Installing 'Breeze.Server.WebApi2 1.4.8'.
Successfully installed 'Breeze.Server.WebApi2 1.4.8'.
Install failed. Rolling back...
Install-Package : Updating 'Microsoft.AspNet.WebApi.Core 5.1.1' to 'Microsoft.AspNet.WebApi.Core 5.0.0' failed. Unable to find a version of 'Microsoft.AspNet.WebApi.WebHost' that is 
compatible with 'Microsoft.AspNet.WebApi.Core 5.0.0'.At line:1 char:1
+ Install-Package Breeze.Server.WebApi2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

1 个答案:

答案 0 :(得分:1)

我遇到的问题与我修复使用此命令的方式相同

  
    

Install-Package Breeze.WebApi2.EF6 -DependencyVersion Highest

  

这允许我使用可用的最高依赖版本。

请注意,此参数在nuget包管理器中的版本晚于2.7.2

见链接 http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference