在 Visual Studio 中粘贴引用时出现错误 HRESULT E_FAIL
我知道这不是一个编程问题,而是一个编程工具问题。
在 Visual Studio 2008 Team Edition(带有 .NET 3.5 SP1 的版本 9.0)中,当我将引用从一个 csproj 复制并粘贴到另一个 csproj 时(使用“解决方案资源管理器”视图中的上下文菜单),出现以下错误:
调用 COM 组件返回了错误 HRESULT E_FAIL
这在我的计算机上才刚刚开始发生。我只能找到这篇关于它的文章,它不包含解决方案。
有什么想法吗?
I know this isn't a programming question but it is a programming tool question.
In Visual Studio 2008 Team Edition (version 9.0 with .NET 3.5 SP1) when I copy and paste references from one csproj to another (with the context menu in the 'Solution Explorer' view) I get the following error:
Error HRESULT E_FAIL has been returned from a call to a COM component
This has only just started happening on my machine. I can only find this article about it, and it contains no solution.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是在 Google 上显示的
VS 2010 粘贴引用 E_FAIL
等的排名第一的命中,所以我想我会分享这个解决方法:不要通过上下文菜单使用复制/粘贴引用解决方案资源管理器。
相反:
您感兴趣的参考文献并复制
XML节点。
包含类似
的
节点,并将您的引用粘贴到其上方。您的参考现已复制到目标项目中。
显然,至少,使用环境变量的引用存在问题,如 这里(尽管在我的例子中,我遇到了不使用环境变量的引用的问题,并且在 Visual Studio 2010 中......)
This is the #1 hit that shows up on Google for
VS 2010 paste reference E_FAIL
and the like, so I thought I would share this workaround:Don't use copy/paste references via the context menu in Solution Explorer.
Instead:
reference(s) you are interested in and copy the
<Reference>
XMLnode(s).
the
<ItemGroup>
node containing something like<Reference Include="mscorlib" />
, and paste your reference just above it.Your reference is now copied into the target project.
Apparently, at the very minimum, there is a problem with references that use environment variables, as described here (although in my case, I was having a problem with references that did not use environment variables, and in Visual Studio 2010...)
哎呀,E_FAIL 是最常见的 COM 错误,因为它字面意思是 COM 函数返回失败。我猜测 Visual Studio 2008 不知何故在某处有一个损坏的 COM 对象。
您是否尝试过重新安装 Visual Studio 2008 只是为了让它重新注册所有 tlb 和对象?
Yikes , E_FAIL is the most generic COM error , since it literally means a COM function returned fail. I would guess that somehow , visual studio 2008 has a corrupted COM object somewhere.
Have you tried reinstalling visual studio 2008 just to get it to re-register all its tlb's and objects ?