NuGet:“无法加载一种或多种请求的类型”

发布于 2024-10-09 18:02:30 字数 305 浏览 0 评论 0原文

我将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月下伊人醉 2024-10-16 18:02:30

原来这个错误是在没有安装PowerShell的情况下发生的。为了进一步诊断问题,我转到“工具”>“库包管理器>包管理器控制台,控制台显示红色文本:

错误:程序包管理器控制台需要 PowerShell 2.0 运行时,但本计算机上未检测到该运行时。请从 http://support.microsoft.com/kb/968929 安装 PowerShell 2.0 并重新启动Visual Studio。

安装 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:

Error: The Package Manager Console requires PowerShell 2.0 runtime, which is not detected on this machine. Please install the PowerShell 2.0 from http://support.microsoft.com/kb/968929 and restart Visual Studio.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文