开发者

Calling a DLL from C# (VS2008)

I have a DLL (Test.dll) which contains some Excel Addin, i don't know which version this is build with (might be with VB6, but i am not sure).

When i tried referencing this DLL in the VS2008 i get the message

A reference to the <DLL Name> could not be added. Please make sure that the file is accrssible, and that it is a valid assembly or COM Component.

If anyone could please help me in this, it will be great.

Any help is appreciated.

Thank开发者_StackOverflow中文版s and Regards, Tushar


It seems to me the DLL you're trying to load isn't a managed DLL, or one that the CLR can treat as managed.

One solution would be to use managed C++ (C++/CLI) to build a wrapper around the DLL. Another is to use PInvoke which is explained here and there's a tool for it I came across here.

You can also look in this thread: Unable to Use DLL of VB6 Into ASP.NET.

Hope one these work out for you, Asaf

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜