Today I tried the software I’ve been writing on another computer – and it immediately crashed. I got this error message:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘TrackerInterface-Mixed-Full.dll’ or one of its dependencies. The specified module could not be found.
Here, it tells me that my DLL “TrackerInterface-Mixed-Full.dll” could not be loaded. The first thing I thought was that the application couldn’t locate this DLL – because of the
FileNotFoundException. Unfortunately this wasn’t the problem.
So I figured “or one of its dependencies” was the real problem. However, the error message doesn’t tell you what dependency (DLL) is actually missing – even when debugging.
So, I did some searching and found the Assembly Binding Log Viewer (or “Fusion Log Viewer”) which comes with Visual Studio. Unfortunately it didn’t do what I needed. It seems that this is actually more for .NET assemblies rather than native DLLs. (You need to run it with Adminstrator rights; otherwise it won’t work. Just in case you’ll ever need it.)
After some more searching I found a tool called Dependency Walker. And that’s exactly what did the trick. So I opened “TrackerInterface-Mixed-Full.dll” with it and got the following result:
Here you have my “TrackerInterface-Mixed-Full.dll” at the top of the tree and its dependencies listed below it. For one, you can see immediately that the file “QTCORED4.DLL” is missing. But you can also see that one dependency (“MAPPARSERD1.DLL”) is missing some dependencies as well. (Fortunately, Dependency Walker automatically expands all dependencies that again have missing dependencies.)
I hope this helps in case you’re running into this problem yourself.
Note: The part “The specified module could not be found.” of the error message indicates some missing DLLs. There can be other reasons for getting a “Could not load file or assembly ‘Assembly.dll’ or one of its dependencies.” which then have other texts after this one.
Note 2: This only seems to happen when using native DLLs from .NET applications/assemblies.