0

paket restore用来从提要中下载大量的 nuget 包https://api.nuget.org/v3/index.json

成功下载一些包后,它会报告InvalidDataException: End of Central Directory record could not be found.一个包(每次不同)。

当我查看 Nuget 缓存(Windows 10)中的包时,它包含来自提要索引的 json https://api.nuget.org/v3/index.json,而不是预期的内容。

例如,System.Net.Http 4.3.4.nupkg在记事本中打开文件显示内容为:

{
  "version": "3.0.0",
  "resources": [
    {
      "@id": "https://azuresearch-usnc.nuget.org/query",
      "@type": "SearchQueryService",
      "comment": "Query endpoint of NuGet Search service (primary)"
    },
    {
      "@id": "https://azuresearch-ussc.nuget.org/query",
      "@type": "SearchQueryService",
      "comment": "Query endpoint of NuGet Search service (secondary)"
    },
// etc

所以看起来请求以某种方式被重定向到提要的根目录。

请问有什么可能导致这种情况的想法吗?

4

1 回答 1

0

I think I have a fix, but not a reason why!

I had been clearing my Nuget cache after each error with

  • nuget locals all -clear

That didn't help. I then tried

  • paket clear-cache

And then my paket restore worked fine.

于 2020-09-08T15:21:33.337 回答