1

I have a project that references a dll file. I simply added a reference by right clicking on the properties, selected add reference, and browsed for the dll. Intellisense recognizes the library and all it's classes/methods but when I run it I get this.

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in program.exe

Additional information: Could not load file or assembly 'Api.dll' or one of its dependencies. The specified module could not be found.

The file appears in the bin folder and is still at the location I browsed too. The program runs without errors if I don't use any classes or methods. The library doesn't have any dependencies I'm aware of.

Edit: found a lot of missing dependent DLL files using dependency walker that I thought were causing the problem. After putting all the dependent DLL's in the same folder and referencing it the problem persists

Cameron Scully
  • 103
  • 1
  • 12

2 Answers2

1

Run Fusion Log Viewer when you run your app. It will tell you exactly what assembly isn't loading.

If nothing shows up in Fusion Log Viewer when you run it, try these settings:

enter image description here

enter image description here

I never did understand why results wouldn't show up unless I used the settings this way. I would delete all entries, run the app, then hit the Refresh button.

Bob Horn
  • 33,387
  • 34
  • 113
  • 219
  • No applications showed up in the viewer. Is there some special way I'm supposed to debug the program to get it to log the assembly? – Cameron Scully Oct 25 '12 at 21:12
  • The exception is thrown when I try to step into the method that uses the API, not the line with the API itself – Cameron Scully Oct 25 '12 at 21:24
  • That helped. It says the AveAPI was loaded successfully in the log but that MyProgram.resources failed. I tried publishing it and running it and the exception text didn't show the API loaded in the assembly list. – Cameron Scully Oct 26 '12 at 16:57
0

Turns out that even once I found the missing DLL's using dependency walker that they weren't being imported into my project with the original DLL. Moving them into the bin/debug folder fixed the error

Cameron Scully
  • 103
  • 1
  • 12