DllNotFoundException, but DLL is there

Asmor picture Asmor · Aug 7, 2009 · Viewed 52.8k times · Source

So I'm using an SDK for a hardware random number generator which provides a dll called PsyREG.dll for interacting with it, as well as some c# source for using the methods from the dll.

It has worked in the past, but somehow it has stopped working. My hands are a bit tied as I don't actually have access to the device in question at the moment, so I can't try a lot of things...

However, here's the weird thing. The dll is there, the same place it's always been. Ahd in fact File.Exists("PsyREG.dll") returns true, and I've double checked and that's the exact same way the provided c# source imports it, e.g. [DllImport("PsyREG.dll")].

Any ideas?

Answer

Cleiton picture Cleiton · Aug 7, 2009

Probably this DLL has some dependencies that aren't registered or aren't in the same folder as your application.