none
How to add and use an old DLL library in a C# project RRS feed

  • Question

  • I have a DLL library and want to use that in my C# project in VS.NET 2003. when I try to add a link to my library the VS show following message

          "A reference to  'c:\abc.dll'  could not be added. This is not a valid assembly or   COM component. Only assemblies with extension  dll   and COM components can be referenced. Please make sure that the file is accessible, and that is a valid assembly or COM component"

       by the way the library is working well with the VC++ project...

       please can anyone help me on this..?

    Monday, April 3, 2006 2:58 PM

Answers

  • You can't add a reference to an unmanaged dll (C++) like you can with Managed (.NET) dlls.

    Instead, have a look at the DllImportAttribute.

    Monday, April 3, 2006 3:49 PM
    Moderator

All replies

  • You can't add a reference to an unmanaged dll (C++) like you can with Managed (.NET) dlls.

    Instead, have a look at the DllImportAttribute.

    Monday, April 3, 2006 3:49 PM
    Moderator
  • Did you register already in GAC? If not then this, regsvr32 /i <dll name>.
    Monday, April 3, 2006 9:05 PM