LoaderExceptions Property - .NET Framework

Error Message

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

Resolution

Add a try/catch block to your code, similar to the following.

try 
{
    // Your existing code is here
}
catch (ReflectionTypeLoadException ex)
{
    StringBuilder sb = new StringBuilder();
    foreach (Exception exSub in ex.LoaderExceptions)
    {
        sb.AppendLine(exSub.Message);
        if (exSub is System.IO.FileNotFoundException)
        {
            var exFileNotFound = exSub as System.IO.FileNotFoundException;
            if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
            {
                sb.AppendLine("Fusion Log:");
                sb.AppendLine(exFileNotFound.FusionLog);
            }
        }
        sb.AppendLine();
    }
    Log("ERROR - " + sb.ToString());
    throw;
}