nuget - 在 nuget 还原包中构建 C# 项目失败 Microsoft.ApplicationInsights

标签 nuget travis-ci nuget-package-restore

我有这个Azure Notification Hubs Sample

它失败了,因为

The 'Microsoft.ApplicationInsights 0.12.0-build17386' package requires NuGet client version '2.8.50313' or above, but the current NuGet version is '2.8.1.0'. The command "eval nuget restore src/NotificationHubSample.sln" failed. Retrying, 2 of 3.

为什么?

最佳答案

这是 Microsoft.ApplicationInsights NuGet 包的问题。在其 .nuspec 文件中包含以下内容:

<metadata minClientVersion="2.8.50313">

NuGet 将根据其产品版本检查 NuGet 包定义的 minClientVersion,以查看它们是否兼容。

Microsoft.ApplicationInsights NuGet 包中使用的 minClientVersion 似乎使用 NuGet 程序集文件版本,而不是 NuGet 产品版本。因此,NuGet 恢复或安装总是会失败,至少在发布更新版本的 NuGet 之前是这样。最新发布的 NuGet 的产品版本为 2.8.3。

请注意,我忽略了当前有 CTP 版本的 NuGet 3.0。因此,此 NuGet 包可与 NuGet 3.0 配合使用,因此 Microsoft.ApplicationInsights NuGet 包的创建者可能仅使用该版本对其进行了测试。

所以你的选择是:

  1. 向 Microsoft.ApplicationInsights NuGet 软件包的所有者报告问题并等待他们修复。
  2. 使用 NuGet.exe 3.0 通过 Travis 运行包恢复。
  3. 使用没有此 minClientVersion 限制的不同版本的 Microsoft.ApplicationInsights NuGet 包。

关于nuget - 在 nuget 还原包中构建 C# 项目失败 Microsoft.ApplicationInsights,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27901603/

相关文章:

c# - 自定义存储库中的某些包无法在 C# 中恢复 nuget 包

java - Travis Spring 的 JUnit 测试失败

visual-studio-2015 - Nuget 无缘无故抛出 401 未经授权的错误

c++ - NuGet with TeamCity for project shared by 2 solutions - .h file not found

visual-studio-2017 - 使用 NuGet Package Explorer 和 Azure DevOps Artifacts

c# - NuGet - 此包尚未编入索引。它将出现在搜索结果中,并且在索引完成后可用于安装/恢复

linux - 公司代理背后的 Linux 上的 dotnet restore、NuGet 和 VS Code 问题

java - 使用 Travis CI 分析 SonarQube.com 上的 Java Gradle 项目

github - Travis.yml 因内容简约而失败?

c# - Nuget 还原因身份验证而失败