2016-12-29 132 views
0

我試圖添加FluentValidation到我的asp.net核心項目。 本來我想用Nuget FluentValidation.AspNetCore/6.4.0-beta9和這個pakage取決於Nuget FluentValidation/6.4.0-beta9。所以我將FluentValidation添加到了project.json。FluentValidation 6.4.0-beta * Nuget包恢復失敗,操作超時

{ 
    "dependencies": { 
    "Microsoft.NETCore.App": { 
     "version": "1.0.1", 
     "type": "platform" 
    }, 
    "Microsoft.AspNetCore.Mvc": "1.0.1", 
    "Microsoft.AspNetCore.Routing": "1.0.1", 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", 
    "Microsoft.Extensions.Configuration.Json": "1.0.0", 
    "Microsoft.Extensions.Logging": "1.0.0", 
    "Microsoft.Extensions.Logging.Console": "1.0.0", 
    "Microsoft.Extensions.Logging.Debug": "1.0.0", 
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", 
    ..., 
    "FluentValidation": "6.4.0-beta9" 
    }, 
    .... 
} 

這會導致程序包恢復失敗消息包含以下輸出。

log : Restoring packages for C:\Users\asdf\devel\BTnetCorePoc\NcCqrsPoc\src\NcCqrsPos.Web.Commands\project.json... 
log : Retrying 'FindPackagesByIdAsyncCore' for source 'http://10.0.10.49/NugetServer/nuget_error/FindPackagesById()?id='FluentValidation''. 
log : An error occurred while sending the request. 
log : The operation timed out 
log : Retrying 'FindPackagesByIdAsyncCore' for source 'http://10.0.10.49/NugetServer/nuget_error/FindPackagesById()?id='System.Text.RegularExpressions''. 
log : An error occurred while sending the request. 
log : The operation timed out 
.... 
error: Failed to retrieve information from remote source 'http://10.0.10.49/NugetServer/nuget_error/FindPackagesById()?id='FluentValidation''. 
error: An error occurred while sending the request. 
error: Failed to retrieve information from remote source 'http://10.0.10.49/NugetServer/nuget_error/FindPackagesById()?id='System.Text.RegularExpressions''. 
error: An error occurred while sending the request. 

因此,它會導致任何TimeOut,我不太瞭解nuget包發佈如何工作。超時似乎有一個服務器不可用或這樣的,但上面鏈接的nuget包頁面運行良好(,但我認爲這只是一個索引頁)。而IP 10.0.10.49似乎是更復雜的ip恢復包。我是否可能錯過配置vs Studio中的任何nuget源路徑? (在寫這個問題的時候會引起我的注意,我會在稍後檢查)

要使用FluentValidation.AspNetCore,我至少需要FluentValidation 6.4.0-beta1的版本。所以,我想最版本
FluentValidation 6.4.0-β1 FluentValidation 6.4.0-beta9 (這是我的目標)
和每一個嘗試用相同的超時錯誤failes(becuz超時需要一些分鐘,我不知道如何硬停止,恢復過程)

後,我試圖恢復FluentValidation 的早期版本,我不能使用(FluentValidation.AspNetCore至少需要FluentValiedation 6.4.0-β1) ,我檢查了nuget restore是否適用於較老的和穩定的FluentValidation。我試着以下版本:

FluentValidation 6.2.1 (最新的穩定) FluentValidation 6.2.1-β1
FluentValidation 6.3.3-α
FluentValidation 6.3.4-α

恢復這些版本的Works以及所以我認爲錯誤不能是我的機器上的任何一種missconfigured VS。那麼其他問題在哪裏呢?我的下一步應該是什麼?此後我創建了一個FluentValidation Github Repo Issue

回答

0

像JeremySkinner建議的FluentValidation Github Issue。我刪除了額外的配置包源,在VS2015配置(工具 - >選項 - >的NuGet打包程序管理器 - >打包機來源:取消我addidional定製10.0.10.49/NugetServer - >確定)
現在試圖恢復 FluentValidation 6.4.0-beta9 效果良好

所以有一個奇怪的行爲,我無法弄清楚爲什麼這個問題發生時,額外的套餐來源定義。我只是記住這一點。我不需要額外的軟件包源,因此只需停用它即可解決該問題。