2017-02-13 736 views
0

我已經從朋友克隆了一個回購,而當我正在執行還原NugetPackages時,很多程序包都無法獲得。Nuget:NU1001依賴項*無法解析。 (錯誤:... 100000ms後超時。)

在輸出我得到想了很多記錄:

log : Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/nunit/index.json'. log : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/nunit/index.json' has timed out after 100000ms. log : Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/libuv/index.json'. log : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/libuv/index.json' has timed out after 100000ms. log : Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/moq/index.json'. log : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/moq/index.json' has timed out after 100000ms. log : Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.design/index.json'. log : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.design/index.json' has timed out after 100000ms.

/*...CODE REMOVED FOR READABILITY...*/

log : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration.fileextensions/1.1.0/microsoft.extensions.configuration.fileextensions.1.1.0.nupkg' has timed out after 100000ms. error: Failed to retrieve information from remote source 'https://api.nuget.org/v3-flatcontainer/nunit/index.json'. error: The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/nunit/index.json' has timed out after 100000ms. error: Failed to retrieve information from remote source 'https://api.nuget.org/v3-flatcontainer/nunit/index.json'. error: The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/nunit/index.json' has timed out after 100000ms.

工具:
的Visual Studio 2015年的社區,更新3

DOTNET --version 1.0.0-preview2-003131

的NuGet 3.5.0

我的解決方案管理器看起來像波紋管形象: enter image description here

一個包。 json file ` { 「title」:「Ghp」, 「version」:「1.0.0」, 「說明」: 「GHP」, 「版權」: 「」, 「作家」: 「」],

"packOptions": { 
    "tags": [ "ghp" ], 
    "projectUrl": "", 
    "licenseUrl": "", 
    "repository": { 
     "type": "git", 
     "url": "" 
    } 
}, 

"buildOptions": { 
    "emitEntryPoint": false 
}, 

"frameworks": { 
    "netstandard1.6": { 
     "imports": [ 
      "dnxcore50", 
      "portable-net451+win8" 
     ] 
    }, 
    "net46": { 
     "frameworkAssemblies": { 
      "System.ComponentModel.DataAnnotations": "4.0.0.0" 
     } 
    } 
}, 

"dependencies": { 
    "Microsoft.EntityFrameworkCore": "1.1.0", 
    "Newtonsoft.Json": "9.0.1", 
    "Microsoft.EntityFrameworkCore.InMemory": "1.1.0", 
    "Microsoft.EntityFrameworkCore.Relational": "1.1.0", 
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", 
    "Microsoft.Extensions.Configuration": "1.1.0", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", 
    "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0", 
    "Microsoft.Extensions.Configuration.Json": "1.1.0", 
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0", 
    "Microsoft.Extensions.Localization": "1.1.0", 
    "Microsoft.Extensions.Logging": "1.1.0", 
    "Microsoft.Extensions.Logging.Console": "1.1.0", 
    "Microsoft.Extensions.Logging.Debug": "1.1.0", 
    "System.Diagnostics.StackTrace": "4.3.0" 
} 

}`

如果有人知道,給我一個提示如何用Nuget恢復解決問題。

謝謝。

回答

1

問題是因爲我安裝了Microsoft .NET Core 1.x.x - SDK 1.x.x Preview-x的多個版本,並且相同的Microsoft .NET Core 1.x.x - VS 2015 Tooling Preview-x

解決的辦法是卸載所有那些老SDKVS 2015年模具和下載和https://www.microsoft.com/net/download/core

之後安裝可用的最新版本,包被正確恢復和解決方案已成功重建。


現在我有了這套工具:
- Microsoft .NET Core 1.0.1 - SDK 1.0.0 Preview 2-003131 (x64)
- Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2
- Microsoft .NET Core 1.0.3 - SDK 1.0.0 Preview 2-003156 (x64)
- Microsoft .NET Core 1.1.0 - Runtime (x64)
- Visual Studio Community 2015 Update 3

+0

很高興知道你有找到解決這個問題的原因。請標記您的答案,這對其他有相同問題的社區是有好處的。謝謝。 –

+0

@ Leo-MSFT,謝謝您的關心。我必須等待預定的時間間隔,直到可以接受解決問題的答案;) – meorfi

+1

非常感謝。這也解決了我的問題。 –

0

您能訪問您要恢復的瀏覽器中的源文件嗎?例如https://api.nuget.org/v3-flatcontainer/nunit/index.json?如果是,則可以使用以下方法作爲臨時解決方案:

  1. 手動從NuGet.org下載這些軟件包。
  2. 設置本地存儲庫並將這些下載包添加到。
  3. 從本地存儲庫還原軟件包。在此之前,您需要將本地存儲庫添加到包源:工具 - >選項 - > NuGet包管理器 - >包源。

注意:包「FindPackagesByIdAsync」應該是一個顧客包,它不能被之前一直推到NuGet.org或服務器下載。需要獲取此包並將其設置到本地存儲庫中。

如果無法訪問該來源,則需要檢查您的網絡設置。

相關問題