无法添加对 dll 的引用 [英] A reference to the dll could not be added

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

问题描述

当我在 C# 应用程序中添加一个 .dll 文件作为参考时,它显示一个错误:

When I add a .dll file as a reference in C# application it shows an error :

无法添加对....dll"的引用.请确保该文件是可访问的,并且它是一个有效的程序集或 COM组件.

A reference to the "....dll" could not be added.Please make sure that the file is accessible and that it is a valid assembly or COM component.

ILDissassembler 说没有有效的 CLR 头,所以我尝试使用 regsvr32 注册它,这给了我另一个错误:

ILDissassembler says there is no valid CLR header so I try to register it using regsvr32 and that gives me another error:

模块 "" 已加载,但对 DLLRegisterServer 的调用失败错误代码'0x80004005'

The module "" was loaded but the call to DLLRegisterServer failed with error code '0x80004005'

我在 64 位 Windows 7 机器上使用 VS2010 终极版.可能是什么问题?

I am using VS2010 ultimate version on a 64bit Windows 7 machine. What could be the problem?

感谢您的任何提示/回复

Thanks for any hints/replies

推荐答案

我使用了 Dependency walker 来检查 dll 的内部引用.原来它需要 VB 运行时 msvbvm60.dll,并且由于我的开发箱没有安装它,我无法使用 regsvr32 注册它

I used dependency walker to check out the internal references the dll was having. Turns out it was in need of the VB runtime msvbvm60.dll and since my dev box doesnt have that installed I was unable to register it using regsvr32

这似乎是我现在最初问题的答案.

That seems to be the answer to my original question for now.

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

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