2016-12-29 88 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 效果良好

所以有一个奇怪的行为,我无法弄清楚为什么这个问题发生时,额外的套餐来源定义。我只是记住这一点。我不需要额外的软件包源,因此只需停用它即可解决该问题。