1

I have a predominantly managed c# .net 4.6 app that is trying to call into a c++ dll (that is also built as part of the solution), Visual Studio 2017.

I get this exception: "System.IO.FileNotFoundException: 'Could not load file or assembly 'XXX.dll' or one of its dependencies. The specified module could not be found.'"

There doesn't appear to be any more information. The dll is in our binaries directory with all our other dlls that load fine, and the exe that is being run in the debugging session (The start up project).

I've checked the solution configuration manager, its building the dll as x64 in our Debug|Any CPU config, which makes sense.

No one else in the office has this issue, and I didn't have this issue on my old computer (I'm getting now trying to set up my new dev computer, which is the exact same specs as the old one) Windows 10.

I have the WindowsSDK 8.1 and 10 installed, and the vs c++ redistributes.

Any Ideas? Or atleast, and idea how I can get more info about whats actually going wrong? (This exception is frustratingly vague).

matt
  • 4,042
  • 5
  • 32
  • 50

1 Answers1

1

You’d want to use Fuslogvw.exe, the assembly binding log viewer. It can be started by launching the Developer Command Prompt for VS. The first thing is to enable logging, and the simplest way is to run as administrator (as a comment to an answer here correctly points out); you can alternatively set the ForceLog regkey specified here if running as a regular user account.

There's also a small video I did a while back to test how this works. You can find this in this article. Just scroll to the bottom, it's within the 2nd question starting from the end.

If that doesn't work, run Process Monitor and set a filter for your specific .dll and see what the CLR does in detail when searching for it.

Mihai Albert
  • 1,288
  • 1
  • 12
  • 27