What could be causing a System.TypeLoadException?

It could be any number of things. Likely causes are:

  • The assembly cannot be found
  • An assembly that your assembly depends upon cannot be found
  • The assembly is found but the type isn’t in it
  • The type’s static constructor throws an exception

Your best bet is to use the Fusion log viewer to help diagnose it. Documentation is here:

http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

(FYI “Fusion” was the code name of the team that designed the assembly loading system; it is somewhat unfortunate that the code name ended up in the file name of the shipped product. The thing should have been called “AssemblyBindingLogViewer.exe” or some such thing.)

Leave a Comment