Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
I never understood why the exception code that is throwing the error doesn't just provide the LoaderExceptions info in the error message, but such is life. When we get this error, we can deal with it in the following manner:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (Exception ex) | |
{ | |
if (ex is System.Reflection.ReflectionTypeLoadException) | |
{ | |
var typeEx = ex as ReflectionTypeLoadException; | |
var loadEx = typeEx.LoaderExceptions; | |
//Do something with loadEx | |
} | |
} |
C