0

I see this when analyzing my dump file:

0:000> !pe
Exception object: 0000000000ec2228
Exception type:   System.IO.FileNotFoundException
Message:          Could not load file or assembly 'MyTest.exe' or one of its dependencies. The system cannot find the file specified.
InnerException:   <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80070002

How do I find out which assembly could not be loaded? All I have is this dump file and the condition has resolved since the incident so the app is running fine at the moment.

Denis
  • 11,796
  • 16
  • 88
  • 150
  • The exception message told you, it was "MyTest.exe". Oddball name btw, you wouldn't normally expect an EXE file to be troublesome. Some context is required. Better ways to troubleshoot this kind of mishap are loader snaps for unmanaged DLL dependencies, Fuslogvw.exe for managed dependencies and SysInterals' Process Monitor as a generic tool. – Hans Passant Aug 10 '16 at 15:26
  • @HansPassant - I replaced the name of the app in the post (for privacy reasons) but is there a way I can figure out from the dump, what dependency it was missing when it failed. I am familiar with fuslogvw but I believe that is only applicable when the process is running and exhibiting the problem - not when examining the dump. The condition has since cleared up and the app is running fine and all I have is this dump file and I'm playing Sherlock Holmes with this dump file to figure out what happened. – Denis Aug 10 '16 at 20:20

1 Answers1

3

I suggest using DependencyWalker to find out what assemblies are required and compare that to the list of loaded assemblies (lm).

Unfortunately the FileNotFoundException is not very helpful regarding details.

Note that there may be many reasons for an unresolved dependency (this list is not guaranteed to be complete):

  • the DLL does not exist (the obvious)
  • special permissions are required to load the DLL (check NTFS access rights or run the program as administrator)
  • the application is run from a network share which is considered an untrusted location
  • the bitness of the DLL does not match (if that does not result in a BadImageFormatException)
  • a virus scanner is blocking the acces to the file

You can try to get more information

  • !gle to get details about the last error. This is a native function, so it may give additional insights on what went wrong before the .NET exception happened.
  • look into the Windows event log on the machine where the problem happened. If it's a permission issue, you may find information there
  • look at the output of | to see if it was run from a network share
  • if the problem is reproducible, use Fusion Log Viewer [Stack Overflow] / [MSDN] to find out what's going wrong
  • if the problem is reproducible, use Process Monitor to diagnose, add a filter for your application's executable name. Save the results as XML and push it through ProcMon Analyzer (disclaimer: a free tool written by me)
  • Look at the inner exception(s) - but in your case there aren't any
Community
  • 1
  • 1
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222