Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DllNotFoundException, but DLL is there

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?

like image 798
Asmor Avatar asked Aug 07 '09 19:08

Asmor


People also ask

How do I change the DLL code in Visual Studio?

You can easily open a DLL file in Visual Studio the same way you would any other file. To do so, click File in the menu bar at the top, followed by Open. Then click File and select the DLL file you want to open and click Open. This will open the DLL file in a new Resource Editor window.

What is DLL in C#?

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Each program can use the functionality that is contained in this DLL to implement an Open dialog box.


2 Answers

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

like image 198
Cleiton Avatar answered Sep 22 '22 14:09

Cleiton


Open DLL on the problematic system in http://www.dependencywalker.com/

like image 29
cbuteau Avatar answered Sep 25 '22 14:09

cbuteau