引用的DLL无法添加DLL

2023-09-02 10:19:32 作者:最初的孤单

当我添加一个.dll文件在C#应用程序中引用它显示了一个错误:

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

一提到.... DLL不能added.Please确保   该文件是可访问,并且它是一个有效的组件或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失败,   错误code'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.