“无法满足程序包依赖性约束”。与Breeze.Server.WebAPI2 [英] "Unable to satisfy package dependency constraints" with Breeze.Server.WebAPI2

查看:64
本文介绍了“无法满足程序包依赖性约束”。与Breeze.Server.WebAPI2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Breeze.Server.WebAPI2 Nuget包添加到Visual Studio Community 2015 RC中。当我单击安装时,我得到无法满足程序包依赖性约束。

I am trying to add the Breeze.Server.WebAPI2 Nuget package to Visual Studio Community 2015 RC. When I click on install I get "Unable to satisfy package dependency constraints"

列出的依赖性为:

Microsoft.AspNet.WebApi.OData (>= 5.2.2 && < 6.0.0)
Microsoft.AspNet.WebApi.WebHost (>= 5.2.2 && < 6.0.0)
Breeze.Server.ContextProvider (=1.5.4)
WebActivator

我尝试使用自己的软件包添加缺少的依赖项,现在我的packages.config看起来像这样:

I tried adding the missing dependencies using their own packages, and now my packages.config looks like this:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Breeze.Server.ContextProvider" version="1.5.4" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.AspNet.WebApi.OData" version="5.5.1" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net452" userInstalled="true" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" userInstalled="true" />
  <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" userInstalled="true" />
  <package id="System.Spatial" version="5.6.0" targetFramework="net452" userInstalled="true" />
  <package id="WebActivatorEx" version="2.0.6" targetFramework="net452" userInstalled="true" />
</packages>

但是我仍然遇到相同的错误

But I still get the same error

编辑
为了解决该问题,我下载了Visual Studio 2013 Express,并用它来创建项目并添加软件包。然后,我将该项目添加到了Visual Studio2015。没问题,但是我已经启动并运行了。

EDIT To get around the problem I downloaded Visual Studio 2013 Express and used it to create the project and add the package. Then I added the project to Visual Studio 2015. Untidy, but I'm up and running.

推荐答案

此响应有两点:

首先,根据NuGet软件包管理器GitHub问题跟踪器,您收到的消息是一个已知问题,因为有问题的软件包的身份应该已包含在错误消息中

Firstly, according to the NuGet Package Manager GitHub issue tracker, the message you have received is a known issue, in that the identity of the problematic package should have been included in the error message, rather than the generic 'Unable to satisfy package dependency constraints'.

https://github.com/NuGet/Home/issues/241

如问题跟踪工具所示,此问题已解决,但是包含该修补程序的NuGet客户端版本尚未发布。

As indicated in the Issue tracker, this has been resolved, but the version of the NuGet Client that includes the fix has not yet been released.

我在使用Visual Studio 2015 RC的其他软件包中观察到了相同的行为,最新的NuGet软件包管理器客户端(在撰写本文时)是3.0.60410.213。

I have observed the same behaviour for other packages with Visual Studio 2015 RC, for which the latest NuGet Package Manager client (as of writing) is 3.0.60410.213.

other 软件包上调试此错误时,它导致我可能的解决方案:

While debugging this error on other packages, it led me to a potential resolution:

第二次默认情况下,Visual Studio 2015 RC中的NuGet程序包管理器设置为安装依赖关系解析行为设置为最低的程序包。在一种或两种情况下,我遇到无法满足程序包依赖性约束错误,添加了一个程序,将其依赖性解析行为设置为最高已解决了此问题,大概是由于父NuSpec清单中指定的依赖性不正确, 在依存关系图清单中指定的不兼容性。

Secondly By default the NuGet Package Manager in Visual Studio 2015 RC is set to install packages with the Dependency Resolution behaviour set to 'lowest'. In one or two cases where I have encountered the "Unable to satisfy package dependency constraints" error, adding a package with Dependency Resolution behaviour set to 'highest' has resolved this issue, presumably due to either incorrect dependencies specified in the parent NuSpec manifest, or incompatibilities as specified in the dependency graphs manifests.

在后者的一个示例中,Visual Studio 2015 RC中安装了更高版本的软件包项目模板,而不是依赖项链中第三方软件包所支持的模板。上面提到的NuGet错误修复程序应该使识别这些情况更加容易。

One example of the latter a higher version of a package is installed in Visual Studio 2015 RC project templates than is supported by a third-party package in the dependency chain. The NuGet bug fix mentioned above should make identifying these situations much easier.

这篇关于“无法满足程序包依赖性约束”。与Breeze.Server.WebAPI2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆