1

I'm getting the following error while installing the Breeze Server for Web API 2.0.

Updating 'Microsoft.AspNet.WebApi.Core 5.2.0' to 'Microsoft.AspNet.WebApi.Core 5.1.0' failed. Unable to find a version of 'Microsoft.AspNet.WebApi.WebHost' that is compatible with 'Microsoft.AspNet.WebApi.Core 5.1.0'.

Any help is appreciated.

wonderful world
  • 10,969
  • 20
  • 97
  • 194

2 Answers2

2

You must install Breeze.Server.WebApi2 before installing Microsoft.AspNet.WebApi.WebHost.

* EDIT *

This NuGet versioning issue has been fixed in Breeze v1.4.17 (i.e. for the current Microsoft.AspNet... NuGet packages)

* EDIT *

The issue is not with Breeze.Server.WebApi2, but with the Microsoft.AspNet.WebApi.OData package. Breeze.Server.WebApi2 NuGet package requires Microsoft.AspNet.WebApi.OData with version ≥ 5.1 && < 6.0. If you install the Breeze.Server.WebApi2 and Microsoft.AspNet.WebApi.OData is not already installed, it will install the base version (5.1) and not the latest. The issue is that Microsoft.AspNet.WebApi.OData 5.1 depends on Microsoft.AspNet.WebApi.Core version ≥ 5.1.0 && < 5.2.0. That conflicts with Microsoft.AspNet.WebApi.WebHost 5.2 (which you have installed in your solution) as it depends on Microsoft.AspNet.WebApi.Core version >=5.2 and <5.3. So, when Microsoft.AspNet.WebApi.OData is trying to be installed, it will try to roll Microsoft.AspNet.WebApi.Core version to 5.1 and that will fail because Microsoft.AspNet.WebApi.WebHost depends on a newer version.

All this is happening because Breezejs 1.4.16 was tested with Microsoft.AspNet.WebApi 5.1 as version 5.2 had not yet been released at the time. We will update version dependencies on our NuGet packages in the coming release, but this problem is still meant to reoccur in the future as we have no control as to how Microsoft will set their packages dependencies in their coming releases.

The previous workaround is overwork though, as you can simply install the latest Microsoft.AspNet.WebApi.OData package (5.2) before installing Breeze.Server.WebApi2. Microsoft.AspNet.WebApi.OData 5.2 will fulfill the Breeze.Server.WebApi2 dependency and you won’t have installation errors or to deal with the hassle of uninstalling/installing a bunch of packages.

sbelini
  • 526
  • 3
  • 4
  • The Breeze Web API 2 is installed onto a asp.net web api project which has dependency on the webhost. So Breeze WebApi 2 can't be installed first. I think the solution is to release a Breeze Web API that is compatible with the lastest asp.net web api. – wonderful world Aug 05 '14 at 04:02
  • Running in the console also wont resolve the issue. I get now the error: Install-Package : Could not install package 'Microsoft.AspNet.WebApi.OData 5.1.0'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package Breeze.Server.WebApi2 – wonderful world Aug 05 '14 at 04:03
  • We're are investigating the issue and will work on improving our package installation. In the meantime, you'd have to manage the NuGet packages installation order manually. Since you already have webhost package installed, you'd have to uninstall it, install Breeze Web API package, and then re-install the webhost package. Of course, if the webhost is a dependency to another package(s), you will have to cascade the procedure. This workaround might be laborious, but it will work. – sbelini Aug 05 '14 at 20:03
2

I had similar issue with Visual Studio 2013 Update 3.

Installed Microsoft.AspNet.WebApi.OData first and Breeze.Server.WebApi2 both via NuGet

That issue did not appear. For now lets take that as a quick fix.

Pooran
  • 1,640
  • 2
  • 18
  • 25