Possible Duplicate:
How to prevent ReflectionTypeLoadException when calling Assembly.GetTypes()
I would like to get all the types in an assembly. However, I get the following error:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
The problem is the assembly I am getting the types from is referencing another assembly that is only available in the production environment, and not within the unit test environment.
So, is there any way that I can filter GetTypes or something similar to only return the types actually defined in the assembly and not get the type load exception?
e.g. replacement for
.Assembly.GetTypes().Where(t => t.Namespace.Equals(...