.. tilt of the Sphenoid ..

by Setu Trivedi

Fusion Log Viewer

leave a comment »

Otherwise known as the Assembly Binding Log Viewer.  If you are using .NET Reflection to dynamically load Assemblies, you might encounter the following exception from time to time:

{“Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.”}

Fear not – although it took me a while to figure this one out – but its ok, you can thank me later =)

This simply means that the Assembly that you are loading dymacially references a Type that is most likely in another assembly that is referenced but cannot be loaded.  To find out excactly which one it is, you need to fire up the Fusion Log Viewer.  Information on how to use it can be found here.  Set it up, then start your application. Then examine the error log and waallah, it tells you excatly which Assembly failed to load.

Another handy tip.  Most likely the reason why you would be using Reflection and dynamic assembly loading is because you have plugable components in your applications.  And these components most likely are nested somewhere outside the executing folder per se.  You can tell the runtime to probe custom paths when trying to load assemblies using the following tags in your application configuration file between the Configuration tags:

<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="Plugins"></probing>
   </assemblyBinding>
</runtime>

Also, check out the following page on How the runtime locates assemblies and this for more information on the probing element.

Written by Setu

January 15, 2009 at 2:27 pm

Posted in Uncategorized

Leave a Reply