NuGet:“无法加载一种或多种请求的类型”
我将 NuGet 安装到 Visual Web Developer 2010 Express 中,但是当我转到解决方案资源管理器,右键单击项目的“引用”文件夹,然后选择“添加库包引用”时,我立即收到此错误:
无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。
只有一个“确定”按钮,我无法检索它告诉我的附加信息。
这是 NuGet 的全新安装;我以前从未在这台计算机上安装过它。
如何修复和/或诊断此错误以便让 NuGet 正常工作?
I installed NuGet into Visual Web Developer 2010 Express, but when I go to Solution Explorer, right-click on a project's "References" folder, and select "Add Library Package Reference", I immediately get this error:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
There's just an OK button, and no way for me to retrieve the additional information it's telling me about.
This is a fresh install of NuGet; I've never installed it on this computer before.
How can I fix and/or diagnose this error so I can get NuGet to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原来这个错误是在没有安装PowerShell的情况下发生的。为了进一步诊断问题,我转到“工具”>“库包管理器>包管理器控制台,控制台显示红色文本:
安装 PowerShell 后,“添加库包引用”对话框开始工作。
我已经针对 NuGet 提交了一份错误报告,要求在缺少先决条件时提供更好的错误消息(最好是让安装程序实际安装先决条件):
项目#530:“无法加载一种或多种请求的类型”错误
It turns out this error occurs when PowerShell is not installed. In trying to further diagnose the problem, I went to Tools > Library Package Manager > Package Manager Console, and the console came up with red text that said:
After I installed PowerShell, the Add Library Package Reference dialog started working.
I've filed a bug report against NuGet, asking for a better error message when prerequisites are missing (and ideally for the installer to actually install the prerequisites):
Item #530: "Unable to load one or more of the requested types" error