问题描述
在其中一个项目中,我需要重新安装 jQuery NuGet 包(一种 MVC 解决方案).
In one of the projects I needed to reinstall the jQuery NuGet package (a MVC solution).
还有一个Microsoft.jQuery.Unobtrusive.Validation",我应该在删除 jQuery 包之前卸载它.
There were also a "Microsoft.jQuery.Unobtrusive.Validation", that I should uninstall before removing the jQuery package.
现在我尝试(重新)安装 jQuery 包,以及我之前删除的所有依赖包.Microsoft.jQuery.Unobtrusive.Validation"包中断说:
Now I try to (re)install the jQuery package, and all dependent packages I removed before. The "Microsoft.jQuery.Unobtrusive.Validation" package breaks saying:
正在尝试解决依赖项jQuery (≥ 1.8)".
正在尝试解决依赖项jQuery.Validation (≥ 1.8)".
正在尝试解决依赖项jQuery (≥ 1.3.2 && ≤ 1.6)".
将jQuery 1.8.0"更新为jQuery 1.4.1"失败.
找不到Microsoft.jQuery.Unobtrusive.Validation"的版本与jQuery 1.4.1"兼容.
Attempting to resolve dependency 'jQuery (≥ 1.8)'.
Attempting to resolve dependency 'jQuery.Validation (≥ 1.8)'.
Attempting to resolve dependency 'jQuery (≥ 1.3.2 && ≤ 1.6)'.
Updating 'jQuery 1.8.0' to 'jQuery 1.4.1' failed.
Unable to find a version of 'Microsoft.jQuery.Unobtrusive.Validation' that is compatible with 'jQuery 1.4.1'.
是吗?我需要使用最新的 jQuery (2.0.xx)!
was is das? I need to use the latest jQuery (2.0.xx)!
我应该说类似的Microsoft.jQuery.Unobtrusive.Ajax"包没有这个错误".安装没有问题.
I should remark that the similar "Microsoft.jQuery.Unobtrusive.Ajax" package does not have this 'bug'. It was installed without problems.
PS.现在我尝试安装(非微软)jQuery.Validation...
PS. Now I tried to install the (non-Microsoft)jQuery.Validation...
这是错误日志:
正在尝试解决依赖项Microsoft.jQuery.Unobtrusive.Validation (≥ 2.0.20613.0)".
正在尝试解决依赖项 'jQuery.Validation (≥ 1.8 && < 2.0)'.
正在尝试解决依赖项jQuery (≥ 1.3.2 && ≤ 1.6)".
安装jQuery 1.4.1".成功安装'jQuery 1.4.1'.
安装jQuery.Validation 1.8".
成功安装'jQuery.Validation 1.8'.
安装Microsoft.jQuery.Unobtrusive.Validation 2.0.20710.0".
成功安装Microsoft.jQuery.Unobtrusive.Validation 2.0.20710.0".
安装jQuery.Validation.Unobtrusive 2.0.20710.0".
成功安装'jQuery.Validation.Unobtrusive 2.0.20710.0'.
安装失败.
回滚...
将jQuery 1.9.0"更新为jQuery 1.4.1"失败.找不到与jQuery 1.4.1"兼容的bootstrap、jQuery.BlockUI、Microsoft.jQuery.Unobtrusive.Ajax"版本.
Attempting to resolve dependency 'Microsoft.jQuery.Unobtrusive.Validation (≥ 2.0.20613.0)'.
Attempting to resolve dependency 'jQuery.Validation (≥ 1.8 && < 2.0)'.
Attempting to resolve dependency 'jQuery (≥ 1.3.2 && ≤ 1.6)'.
Installing 'jQuery 1.4.1'. Successfully installed 'jQuery 1.4.1'.
Installing 'jQuery.Validation 1.8'.
Successfully installed 'jQuery.Validation 1.8'.
Installing 'Microsoft.jQuery.Unobtrusive.Validation 2.0.20710.0'.
Successfully installed 'Microsoft.jQuery.Unobtrusive.Validation 2.0.20710.0'.
Installing 'jQuery.Validation.Unobtrusive 2.0.20710.0'.
Successfully installed 'jQuery.Validation.Unobtrusive 2.0.20710.0'.
Install failed.
Rolling back...
Updating 'jQuery 1.9.0' to 'jQuery 1.4.1' failed. Unable to find versions of 'bootstrap, jQuery.BlockUI, Microsoft.jQuery.Unobtrusive.Ajax' that are compatible with 'jQuery 1.4.1'.
推荐答案
我现在也遇到了同样的问题.
I just ran into this same issue now.
使用 NuGet,我添加了jQuery",然后添加了jQuery Validatation"再次尝试Microsoft jQuery Unobtrusive Validation",这次它安装得很好:)
Using NuGet I added "jQuery", then "jQuery Validatation" Tried "Microsoft jQuery Unobtrusive Validation" again, this time it installed nicely :)
这篇关于添加“Microsoft.jQuery.Unobtrusive.Validation"包要求 jQuery 1.4.1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!