When I try to add a dll file into my project the following error occurs :

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

But I have imported the dll file using DLLImport statement. This is urgent. Hence please suggest a solution at the earliest. I tried using regsvr32 also.

Thanks & Regards,

Mohana88

have you checked the location of DLL you want to add is that accessible or not? if not then first place the DLL in you debug folder and then add in your project

It is in the debug folder. Still I am not able to add the reference

It is showing an error "Unable to load DLL <name>.dll. The Specific module could not be found" when i try to execute the code with out adding the dll as reference.

I found the issue.... The DLL is dependent on 2 more DLLs Kernel32.dll and msvcr90.dll. But I am not able to add them into project.... Any ideas??????? Its urgent....... It is saying "DLL loaded.DLLRegistryServer entry point not defined"....

Thanks alot....... I used Dependency walker to find the dependencies of that DLL and solved it

This question has already been answered. Start a new discussion instead.