Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I have a problem related to a dll.
Also I don't have errors when I put the functions from the dll in my project but when I run the project using the functions, I get an error from one of the funstions that the dll could not be found.
I took that dll from an example project when I installed the XL driver Library (Vector) and if I run that project it works, but when I use the dll on my project it doesn't work.
How can I resolve this problem?

Thanks.

What I have tried:

I added the dll on my project by using "Add Reference".
Is there something else that I have to do because on another project I added the dll by using "Add Reference" and the functionality worked.
Posted
Updated 26-Sep-17 20:47pm

1 solution

Without seeing your code, and being able to look over your shoulder at exactly what you are doing we can't really tell.
But ... there are two types of DLL files: Assemblies which .NET recognises and which require a Reference to be added, and Dynamic Link Libraries (also known as Native libraries) which it doesn't, and you don't.

So start by looking at the error message closely: it will give you the name of the DLL file it is looking for. Check for that in your project: is it in the references list? If it is, check that it's built for the same CPU type as your project, and that the Reference properties option "Copy Local" is set to true.
If it isn't, try adding it. If that works, try rebuilding. If it doesn't, then it's probably a Native Library, and you need to ensure that the DLL is either in the EXE folder, or in a folder on the current PATH that Windows uses to locate executables.
 
Share this answer
 
Comments
Todiruta Costel Nicusor 27-Sep-17 3:08am    
It works now, it seems that I forgotten to insert also two new dll's.
And you answer it helped because the dll's are Native Library.
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900