NuGet无法安装FluentValidation [英] NuGet Fails to Install FluentValidation

查看:135
本文介绍了NuGet无法安装FluentValidation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装NuGet软件包Nancy.Validation.FluentValidation,但是由于我认为框架不受支持而导致安装失败?

I am attempting to install the NuGet package Nancy.Validation.FluentValidation but the installation fails due to, I think, unsupported frameworks?

完整的NuGet错误如下.我正在使用.NET 4.5.我看不出为什么会失败?任何想法出了什么问题吗?

The full NuGet error is below. I am using .NET 4.5. I cant see why it would fail? Any ideas what is going wrong?

安装Nancy.Validation.FluentValidation时的输出:

Attempting to resolve dependency 'Nancy (≥ 1.2.0)'.
Attempting to resolve dependency 'FluentValidation'.
Installing 'FluentValidation 5.6.2.0'.
Successfully installed 'FluentValidation 5.6.2.0'.
Installing 'Nancy.Validation.FluentValidation 1.2.0'.
Successfully installed 'Nancy.Validation.FluentValidation 1.2.0'.
Adding 'FluentValidation 5.6.2.0' to Server.
Uninstalling 'FluentValidation 5.6.2.0'.
Successfully uninstalled 'FluentValidation 5.6.2.0'.
Install failed. Rolling back...
Specified argument was out of the range of valid values.
Parameter name: supportedFrameworks

安装FluentValidation时的输出:

Installing 'FluentValidation 5.6.2.0'.
Successfully installed 'FluentValidation 5.6.2.0'.
Adding 'FluentValidation 5.6.2.0' to Server.
Uninstalling 'FluentValidation 5.6.2.0'.
Successfully uninstalled 'FluentValidation 5.6.2.0'.
Install failed. Rolling back...
Specified argument was out of the range of valid values.
Parameter name: supportedFrameworks

推荐答案

如果将可移植类库(PCL)配置文件弄乱了,则可能会发生该错误.如果您的计算机上有一个PCL配置文件,其中没有任何配置文件xml文件,则NuGet会抛出该错误.跟踪PCL配置文件已损坏是困难的部分.

That error can happen if the Portable Class Library (PCL) profiles are messed up. If there is a PCL profile on your machine that does not have any profile xml files in it then NuGet will throw that error. Tracking what PCL profile is broken is the difficult part.

跟踪问题的一种方法是使用此命令行应用程序,对其进行编译,然后在引发ArgumentOutOfRangeException的行.那应该给您PCL配置文件名称.然后查看其SupportedFramework目录,以查看其中有哪些.xml文件.它可能不包含.xml文件,也可能仅包含Xamarin .xml文件. Xamarin .xml文件被视为可选文件,因此,如果Xamarin .xml文件是该目录中唯一的配置文件.xml文件,则仍然会发生此异常.

One way to track the problem down is to use this command line app, compile it and put a breakpoint on the line where the ArgumentOutOfRangeException is being thrown. That should give you the PCL profile name. Then look in its SupportedFramework directory to see what .xml files are in there. It may contain no .xml files or it may just contain Xamarin .xml files. The Xamarin .xml files are treated as optional so this exception can still occur if they are the only profile .xml files in that directory.

这篇关于NuGet无法安装FluentValidation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆