babernethy
babernethy

Reputation: 1095

Breeze.Server.WebApi2 Nuget Package Conflict with MVC 5.1.1?

I am trying to install the Breeze.Server.WebApi2 Nuget package, after updating my MVC packages to the current Nuget version (5.1.1) and I am getting the following error (below). Do I need to downgrade the MVC version to (5.0.0) in order to get the current Breeze WebAPI2 package to work?

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

Upvotes: 2

Views: 580

Answers (1)

user3375774
user3375774

Reputation: 11

I ran into same issue the way i fixed is using this command

Install-Package Breeze.WebApi2.EF6 -DependencyVersion Highest

this allowed me to use the highest dependency version available.

please note this argument is available in nuget package manager in version later than 2.7.2

see link http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference

Upvotes: 1

Related Questions