Sadly, references to this exception are usually of an exotic nature and can happen when you e.g. enumerate Types via Assembly.GetTypes()
- case in point, it is happening on one of our deployments but the same set of assemblies work fine on the Integration Server.
In order to harden against this type of error I would like to be able to provoke such an exception to see if my exception handling code works as expected.
Hence any pointers would be useful, e.g. just knowing what kind of things cause this exception.
EDIT
My attempt so far:
- Define a type in assembly A which uses an attribute of assembly B
- Have some code iterate over all types in the assembly where said attribute is specified.
- I build the attribute only when DEBUG flag is true
- I then copy the release build of that dependency into the relevant folder
But I only manage to get a TypeLoadException
with a pretty clear error message