Verify the bitness of the hosting application when you encounter this error.
Visual Studio 2013, for example, runs as a 32 bit process. IIS Express also executes as a 32 bit process. However, I just learned that a Windows Forms application being debugged in Visual Studio 2013 executes as 64 bit process.
A quick way to confirm the correct bitness is to identify the process under the task manager. A 32 bit process will be appended with a *32. Visual Studio for example is represented as devenv.exe *32. However, the Windows Forms application that was being debugged was represented as ApiTestClient.vshost.exe.
In our case, we had copied the 32 bit version of an unmanaged dependency from the bin folder of an ASP.NET classic application into the bin folder of the Windows Form application. This was the problem. We needed to use the 64 bit version of this dll worked instead.