0

So I have this code:

[DllImport("ECDM400Drv", EntryPoint = "ECDM400_Open", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern bool Open(byte PortNo);

And a dll file called ECDM400Drv.dll, which I placed in the root folder, src folder, and even the windows system32 and syswow64 folders just to be safe. I did this because I have another third party dll that I am using, which I had set up the same way and it worked, but when I do the set up with this dll, I get a dll not found exception, telling me it can't locate this file. I tried adding it as a project reference but that did not work either. Any help would be appreciated!

Alfred Shaker
  • 135
  • 3
  • 13

1 Answers1

0

It could be permissions related. The following article has some good solutions that might help you: DllImport generates System.DllNotFoundException

Community
  • 1
  • 1
JasonCoder
  • 1,126
  • 2
  • 12
  • 24
  • my permissions are set to allow all users on my machine to have "full control" on the dll files, so that shouldn't be the problem. – Alfred Shaker Aug 12 '16 at 02:38