GetExportedTypes() exception for ReflectionOnlyLoadFrom
I am getting an error in a piece of code in our framework which I have no idea how to solve.
Basically, we have a list of dlls via Directory.GetFiles("*.dll"), and when iterating over the list and doing Assembly.ReflectionOnlyLoadFrom(filename).GetExportedTypes(), I get an exception : "Method 'abc' has no implementation".
The method is question is implemented in the assembly used in ReflectionOnlyLoadFrom().
I noticed that the method implements an interface which is in another assembly that is also in the list obtained by Directory.GetFiles(). I reordered the list (i.e so that it is in reverse order, so that the inter开发者_如何学Pythonface assembly is reflected first) but I still get the same error.
Any ideas where to look?
JD
Looks like the third party components I am using had some assemblies targeting 3.5 and others targeting 4. Now all are targeting 3.5, the problem has disappeared.
精彩评论