我試圖添加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。